add general ai

This commit is contained in:
2025-04-16 19:21:47 +02:00
parent 78d48fafc6
commit 923ace22f1
10 changed files with 87 additions and 51 deletions

View File

@@ -57,14 +57,14 @@ public class CommandExecutor {
this.dispatcher.onGameEnd();
return;
}
switchPlayerTurn();
switchPlayerTurn(command instanceof UndoCommand);
return;
}
}
private void switchPlayerTurn() {
private void switchPlayerTurn(boolean undone) {
this.game.switchPlayerTurn();
this.dispatcher.onPlayerTurn(this.game.getPlayerTurn());
this.dispatcher.onPlayerTurn(this.game.getPlayerTurn(), undone);
}
/**