refactor dumb ai castling
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user