|
|
@ -227,13 +227,10 @@ public class Board {
|
|
|
|
if (inCheck) {
|
|
|
|
if (inCheck) {
|
|
|
|
isGameOver = true;
|
|
|
|
isGameOver = true;
|
|
|
|
for (Move move : getAllLegalMoves(!movedPiece.black)) {
|
|
|
|
for (Move move : getAllLegalMoves(!movedPiece.black)) {
|
|
|
|
move(move);
|
|
|
|
|
|
|
|
if (!oppositeKing.isInCheck(move, this)) {
|
|
|
|
if (!oppositeKing.isInCheck(move, this)) {
|
|
|
|
isGameOver = false;
|
|
|
|
isGameOver = false;
|
|
|
|
undoMove();
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
undoMove();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (getAllLegalMoves(movedPiece.black).isEmpty()) {
|
|
|
|
} else if (getAllLegalMoves(movedPiece.black).isEmpty()) {
|
|
|
|
isGameOver = true;
|
|
|
|
isGameOver = true;
|
|
|
|