ajout de toutes les données dans la bdd + Modularisation de l'écran fin de partie
This commit is contained in:
34
src/GestionnaireFinDePartie.java
Normal file
34
src/GestionnaireFinDePartie.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package linea;
|
||||
|
||||
import javax.swing.JLabel;
|
||||
|
||||
public class GestionnaireFinDePartie {
|
||||
|
||||
private boolean estGameOver = false;
|
||||
private JLabel labGameOver;
|
||||
private GestionnaireScore gestionnaireBDD;
|
||||
|
||||
public GestionnaireFinDePartie(JLabel labGameOver, GestionnaireScore gestionnaireBDD) {
|
||||
this.labGameOver = labGameOver;
|
||||
this.gestionnaireBDD = gestionnaireBDD;
|
||||
}
|
||||
|
||||
public void declencherGameOver(ZoneDessin ecran, String pseudo, int score) {
|
||||
estGameOver = true;
|
||||
ecran.arreter();
|
||||
labGameOver.setVisible(true);
|
||||
|
||||
if (pseudo != null && !pseudo.isEmpty()) {
|
||||
gestionnaireBDD.sauvegarderScore(pseudo, score);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean estGameOver() {
|
||||
return estGameOver;
|
||||
}
|
||||
|
||||
public void reinitialiser() {
|
||||
estGameOver = false;
|
||||
labGameOver.setVisible(false);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user