refactor dumb ai castling

This commit is contained in:
2025-04-16 19:25:04 +02:00
parent 923ace22f1
commit bee5e613bb

View File

@@ -35,20 +35,12 @@ public class DumbAI extends AI {
return;
}
case Small: {
int randomMove = this.random.nextInt(moves.size() + 1);
if (randomMove != moves.size())
break;
this.commandExecutor.executeCommand(new CastlingCommand(false));
return;
}
case Small:
case Big: {
int randomMove = this.random.nextInt(moves.size() + 1);
if (randomMove != moves.size())
break;
this.commandExecutor.executeCommand(new CastlingCommand(true));
this.commandExecutor.executeCommand(new CastlingCommand(castlings == CastlingResult.Big));
return;
}