king, copy board logic, getPseudoMoves

This commit is contained in:
CT
2026-04-24 13:34:00 -05:00
parent 984c37a833
commit c3318f834c
16 changed files with 185 additions and 120 deletions

View File

@@ -11,7 +11,12 @@ public class Pawn extends Piece {
colorDir = color.equals("White") ? -1 : 1;
}
public ArrayList<Position> getLegalMoves(Board board) {
public Piece copy() {
Piece newP = new Pawn(this.pos.x, this.pos.y, this.color);
return newP;
}
public ArrayList<Position> getPseudoLegalMoves(Board board) {
ArrayList<Position> positions = new ArrayList<Position>();
// diagonal moves (captures)
@@ -38,4 +43,8 @@ public class Pawn extends Piece {
}
return positions;
}
public ArrayList<Position> getLegalMoves(Board board) {
return null;
}
}