fix console promote
This commit is contained in:
@@ -21,7 +21,7 @@ public class CastlingCommand extends PlayerCommand {
|
||||
@Override
|
||||
public CommandResult execute(Game game, GameListener outputSystem) {
|
||||
final ChessBoard board = game.getBoard();
|
||||
|
||||
|
||||
// we must promote the pending pawn before
|
||||
if (board.pawnShouldBePromoted())
|
||||
return CommandResult.NotAllowed;
|
||||
@@ -39,7 +39,7 @@ public class CastlingCommand extends PlayerCommand {
|
||||
int kingEndX = bigCastling ? 2 : 6;
|
||||
|
||||
int colorLine = game.getPlayerTurn() == Color.White ? 7 : 0;
|
||||
|
||||
|
||||
Coordinate kingCoords = new Coordinate(kingBeginX, colorLine);
|
||||
Coordinate rookCoords = new Coordinate(rookBeginX, colorLine);
|
||||
|
||||
@@ -52,6 +52,10 @@ public class CastlingCommand extends PlayerCommand {
|
||||
return CommandResult.Moved;
|
||||
}
|
||||
|
||||
public boolean isBigCastling() {
|
||||
return bigCastling;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CommandResult undoImpl(Game game, GameListener outputSystem) {
|
||||
game.getBoard().undoMove(this.kingMove, null);
|
||||
|
||||
Reference in New Issue
Block a user