refactor dumb ai castling
This commit is contained in:
@@ -35,20 +35,12 @@ public class DumbAI extends AI {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
case Small: {
|
case Small:
|
||||||
int randomMove = this.random.nextInt(moves.size() + 1);
|
|
||||||
if (randomMove != moves.size())
|
|
||||||
break;
|
|
||||||
this.commandExecutor.executeCommand(new CastlingCommand(false));
|
|
||||||
return;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
case Big: {
|
case Big: {
|
||||||
int randomMove = this.random.nextInt(moves.size() + 1);
|
int randomMove = this.random.nextInt(moves.size() + 1);
|
||||||
if (randomMove != moves.size())
|
if (randomMove != moves.size())
|
||||||
break;
|
break;
|
||||||
this.commandExecutor.executeCommand(new CastlingCommand(true));
|
this.commandExecutor.executeCommand(new CastlingCommand(castlings == CastlingResult.Big));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user