Add of restart option for the start a new game
This commit is contained in:
parent
d64e2962c9
commit
1df06a1068
|
|
@ -307,18 +307,21 @@ public class MyInterface extends JFrame {
|
||||||
game.toggleAI(true);
|
game.toggleAI(true);
|
||||||
chckbxWhiteAI.setSelected(false);
|
chckbxWhiteAI.setSelected(false);
|
||||||
chckbxBlackAI.setSelected(false);
|
chckbxBlackAI.setSelected(false);
|
||||||
Object[] options = {"YES", "NO"};
|
Object[] options = {"YES", "NO", "Start a new game"};
|
||||||
int choice = JOptionPane.showOptionDialog(this, "GAME OVER \nDo you want to exit? ",
|
int choice = JOptionPane.showOptionDialog(this, "GAME OVER \nDo you want to exit? ",
|
||||||
"Game Over",
|
"Game Over",
|
||||||
JOptionPane.DEFAULT_OPTION,
|
JOptionPane.DEFAULT_OPTION,
|
||||||
JOptionPane.QUESTION_MESSAGE,
|
JOptionPane.QUESTION_MESSAGE,
|
||||||
null,
|
null,
|
||||||
options,
|
options,
|
||||||
options[1] // default: Medium
|
options[1] // default: NO
|
||||||
);
|
);
|
||||||
switch (choice) {
|
switch (choice) {
|
||||||
case 0: System.exit(0);; // Easy
|
case 0: System.exit(0); // exit
|
||||||
case 1: ; // Medium
|
case 1: ;
|
||||||
|
case 2: clicButtonStart();
|
||||||
|
break;
|
||||||
|
default: ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue