Text shows up when check and checkmate ends game totally or when this
capture
This commit is contained in:
parent
de3721d00c
commit
15827da582
|
|
@ -806,5 +806,4 @@ public String getWinnerText() {
|
||||||
if (isCheckmate(false)) return "White Wins by Checkmate!";
|
if (isCheckmate(false)) return "White Wins by Checkmate!";
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
//hi
|
|
||||||
}
|
}
|
||||||
|
|
@ -60,9 +60,12 @@ public class Game extends Thread {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void aiPlayerTurn() {
|
private void aiPlayerTurn() {
|
||||||
if (board.isGameOver()) return;
|
if (isAITurn() && !board.isCheckmateFlag()) {
|
||||||
if(isAITurn()) {
|
Move bestMove = aiPlayer.computeBestMove(new Board(board));
|
||||||
board.playMove(aiPlayer.computeBestMove(new Board(board)));
|
if (bestMove != null) {
|
||||||
|
board.selectPiece(bestMove.getMovedPiece().getX(), bestMove.getMovedPiece().getY());
|
||||||
|
board.userTouch(bestMove.getToX(), bestMove.getToY());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue