add castling + fix promote undo

This commit is contained in:
2025-04-06 12:33:00 +02:00
parent a2224cf618
commit 6cb1dd826f
5 changed files with 92 additions and 35 deletions

View File

@@ -20,7 +20,6 @@ import chess.controller.OutputSystem;
import chess.controller.commands.CastlingCommand;
import chess.controller.commands.GetAllowedMovesCommand;
import chess.controller.commands.GetPieceAtCommand;
import chess.controller.commands.GrandCastlingCommand;
import chess.controller.commands.MoveCommand;
import chess.controller.commands.PromoteCommand;
import chess.controller.commands.PromoteCommand.PromoteType;
@@ -61,11 +60,11 @@ public class Window extends JFrame implements OutputSystem {
private void buildButtons(JPanel bottom) {
castlingButton.addActionListener((event) -> {
sendCommand(new CastlingCommand());
sendCommand(new CastlingCommand(false));
});
bigCastlingButton.addActionListener((event) -> {
sendCommand(new GrandCastlingCommand());
sendCommand(new CastlingCommand(true));
});
undoButton.addActionListener((event) -> {