promote gui

This commit is contained in:
2025-04-03 22:06:34 +02:00
parent 927ba129f6
commit 0d72e015f1
5 changed files with 91 additions and 15 deletions

View File

@@ -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;