fix en passant

This commit is contained in:
2025-04-15 21:33:49 +02:00
parent 87992b181e
commit edf95a1691
3 changed files with 17 additions and 2 deletions

View File

@@ -30,7 +30,7 @@ public class Move {
int diffY = getFinish().getY() - getStart().getY();
assert Math.abs(diffX) < Coordinate.VALUE_MAX : "Move is too big!";
assert Math.abs(diffX) < Coordinate.VALUE_MAX : "Move is too big!";
assert Math.abs(diffY) < Coordinate.VALUE_MAX : "Move is too big!";
if (diffX == 0)
return Math.abs(diffY);
@@ -53,4 +53,11 @@ public class Move {
return deadPieceCoords;
}
@Override
public boolean equals(Object obj) {
if (obj instanceof Move other)
return this.start.equals(other.start) && this.finish.equals(other.finish);
return false;
}
}