refactor: move promote to chessboard
This commit is contained in:
@@ -20,11 +20,11 @@ public class CastlingCommand extends PlayerCommand {
|
||||
|
||||
@Override
|
||||
public CommandResult execute(Game game, OutputSystem outputSystem) {
|
||||
// we must promote the pending pawn before
|
||||
if (game.pawnShouldBePromoted())
|
||||
return CommandResult.NotAllowed;
|
||||
|
||||
final ChessBoard board = game.getBoard();
|
||||
|
||||
// we must promote the pending pawn before
|
||||
if (board.pawnShouldBePromoted())
|
||||
return CommandResult.NotAllowed;
|
||||
|
||||
if (bigCastling && !board.canBigCastle(game.getPlayerTurn()))
|
||||
return CommandResult.NotAllowed;
|
||||
|
||||
Reference in New Issue
Block a user