mirror of
https://github.com/lov3b/Schack.git
synced 2025-01-18 21:00:11 +01:00
Update Board.java
This commit is contained in:
parent
48cad448d7
commit
8e171a85db
@ -128,7 +128,7 @@ public class Board extends JPanel implements MouseListener {
|
|||||||
ArrayList<Point> opposingAttacks = checkAttacks(!whitesTurn);
|
ArrayList<Point> opposingAttacks = checkAttacks(!whitesTurn);
|
||||||
|
|
||||||
boolean weCanMove = allValidMoves.size() > 0;
|
boolean weCanMove = allValidMoves.size() > 0;
|
||||||
boolean isPatt = false;
|
boolean inSchack = false;
|
||||||
|
|
||||||
for (Point attack : opposingAttacks) {
|
for (Point attack : opposingAttacks) {
|
||||||
Piece attacked = pieces[attack.x][attack.y];
|
Piece attacked = pieces[attack.x][attack.y];
|
||||||
@ -142,10 +142,10 @@ public class Board extends JPanel implements MouseListener {
|
|||||||
} else {
|
} else {
|
||||||
JOptionPane.showMessageDialog(this, "Schackmatt");
|
JOptionPane.showMessageDialog(this, "Schackmatt");
|
||||||
}
|
}
|
||||||
isPatt = true;
|
inSchack = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!isPatt && !weCanMove) {
|
if (!inSchack && !weCanMove) {
|
||||||
JOptionPane.showMessageDialog(this, "Patt");
|
JOptionPane.showMessageDialog(this, "Patt");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user