remove "instanceof Pawn"

This commit is contained in:
2025-04-05 10:26:47 +02:00
parent 9af06e36f8
commit 8c2c6946d7
5 changed files with 66 additions and 6 deletions

View File

@@ -103,7 +103,7 @@ public class ChessBoard {
for (int j = 0; j < Coordinate.VALUE_MAX; j++) {
Coordinate coordinate = new Coordinate(i, j);
Piece piece = pieceAt(coordinate);
if (piece != null && kingIdentifier.visit(piece)) {
if (kingIdentifier.isKing(piece)) {
return coordinate;
}
}