Super IA #5
@@ -55,7 +55,7 @@ public class CommandExecutor {
|
|||||||
case Moved:
|
case Moved:
|
||||||
boolean notifyPlayerTurn = true;
|
boolean notifyPlayerTurn = true;
|
||||||
this.dispatcher.onBoardUpdate();
|
this.dispatcher.onBoardUpdate();
|
||||||
if (checkGameStatus()) {
|
if (!(command instanceof UndoCommand) && checkGameStatus()) {
|
||||||
this.dispatcher.onGameEnd();
|
this.dispatcher.onGameEnd();
|
||||||
notifyPlayerTurn = false;
|
notifyPlayerTurn = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ public class Game {
|
|||||||
playerTurn = Color.getEnemy(playerTurn);
|
playerTurn = Color.getEnemy(playerTurn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this is the bottleneck of algorithms using this chess engine
|
||||||
public GameStatus checkGameStatus(Color color) {
|
public GameStatus checkGameStatus(Color color) {
|
||||||
if (checkDraw())
|
if (checkDraw())
|
||||||
return GameStatus.Draw;
|
return GameStatus.Draw;
|
||||||
|
|||||||
Reference in New Issue
Block a user