promote gui
This commit is contained in:
@@ -24,6 +24,10 @@ public class MoveCommand extends Command {
|
||||
public CommandResult execute(Game game, OutputSystem outputSystem) {
|
||||
final ChessBoard board = game.getBoard();
|
||||
|
||||
// we must promote the pending pawn before
|
||||
if (game.pawnShouldBePromoted())
|
||||
return CommandResult.NotAllowed;
|
||||
|
||||
Piece piece = board.pieceAt(move.getStart());
|
||||
if (piece == null)
|
||||
return CommandResult.NotAllowed;
|
||||
|
||||
Reference in New Issue
Block a user