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,12 +47,13 @@ public class Piece {
this.y = y; 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; return hasMoved;
} }
private boolean hasMoved = false;//initially, no piece has been moved
public void setMoved(boolean moved) { public void setMoved(boolean moved) {
this.hasMoved = moved; this.hasMoved = moved;
} }