mirror of
https://github.com/lov3b/Schack.git
synced 2025-01-18 21:00:11 +01:00
Lägg till en fråga ifall man vill starta om vid schackmatt
This commit is contained in:
parent
8e171a85db
commit
08d004b40b
@ -140,7 +140,11 @@ public class Board extends JPanel implements MouseListener {
|
||||
if (weCanMove) {
|
||||
JOptionPane.showMessageDialog(this, "Du står i schack");
|
||||
} else {
|
||||
JOptionPane.showMessageDialog(this, "Schackmatt");
|
||||
int choise = JOptionPane.showConfirmDialog(this, "Schackmatt\nVill du starta om?");
|
||||
if (choise == JOptionPane.YES_OPTION) {
|
||||
this.pieces = initPieces();
|
||||
whitesTurn = true;
|
||||
}
|
||||
}
|
||||
inSchack = true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user