changement affichage victoire Puissance3

This commit is contained in:
martins 2022-11-12 17:15:24 +01:00
parent a4fb1ee2c6
commit 58f3a9b722
2 changed files with 12 additions and 4 deletions

View File

@ -7,9 +7,7 @@ import fr.iutfbleau.projetAgile.Menu.View.Menu;
public class ObservateurAccueil implements ActionListener{
private Component comp;
public ObservateurAccueil(Component parent){
this.comp=parent;
}
public ObservateurAccueil(Component parent){}
public void actionPerformed(ActionEvent evenement){
int confirmation = JOptionPane.showConfirmDialog(this.comp, "Etes-vous sûr de vouloir retourner au menu ?", "Menu", JOptionPane.YES_NO_OPTION);
if(confirmation == 1) return;

View File

@ -231,7 +231,17 @@ public class Puissance4Panel extends JPanel{
}
public void playerWin(int player){
JOptionPane.showMessageDialog(this, "Le joueur "+String.valueOf(player)+" a gagné");
switch(player){
case 1:
JOptionPane.showMessageDialog(this, "Le joueur "+this.playerOneName+" a gagné");
break;
case 2:
JOptionPane.showMessageDialog(this, "Le joueur "+this.playerTwoName+" a gagné");
break;
case 3:
JOptionPane.showMessageDialog(this, "Le joueur "+this.playerThreeName+" a gagné");
break;
}
}
/**