last notes castling

This commit is contained in:
Louise BERTELOOT 2025-05-18 22:52:58 +02:00
parent 9a8639a2f1
commit 3a6a8f2d72
1 changed files with 3 additions and 2 deletions

View File

@ -47,11 +47,12 @@ public class Piece {
this.y = y;
}
private boolean hasMoved = false;
public boolean hasMoved() {
public boolean hasMoved() {//track if a piece has been moved in the past (for castling)
return hasMoved;
}
private boolean hasMoved = false;//initially, no piece has been moved
public void setMoved(boolean moved) {
this.hasMoved = moved;