feat: working castling
All checks were successful
Linux arm64 / Build (push) Successful in 47s

This commit is contained in:
2025-05-17 18:51:23 +02:00
parent 01f0caf672
commit 646eb6492e
11 changed files with 63 additions and 44 deletions

View File

@@ -44,6 +44,16 @@ public interface CommandSender {
return cmd.getCastlingResult();
}
default boolean canDoCastling() {
CastlingResult castlings = getAllowedCastlings();
return castlings == CastlingResult.Both || castlings == CastlingResult.Small;
}
default boolean canDoBigCastling() {
CastlingResult castlings = getAllowedCastlings();
return castlings == CastlingResult.Both || castlings == CastlingResult.Big;
}
default Piece getPieceAt(int x, int y) {
return getPieceAt(new Coordinate(x, y));
}
@@ -77,7 +87,7 @@ public interface CommandSender {
}
default CommandResult sendBigCastling() {
return sendCommand(new CastlingCommand(false));
return sendCommand(new CastlingCommand(true));
}
default CommandResult sendMove(Move move) {