mirror of
https://github.com/lov3b/Schack.git
synced 2024-11-10 07: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) {
|
if (weCanMove) {
|
||||||
JOptionPane.showMessageDialog(this, "Du står i schack");
|
JOptionPane.showMessageDialog(this, "Du står i schack");
|
||||||
} else {
|
} 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;
|
inSchack = true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user