This commit is contained in:
Yash Shah 2025-05-12 17:10:55 +02:00
parent ceaad980f6
commit 0bf99a6157
1 changed files with 1 additions and 22 deletions

View File

@ -330,27 +330,6 @@ public void undoLastMove() {
}
public void playMove(Move move) {
Piece piece = move.getPieceMoved();
// If a piece is captured, remove it from the board
if (move.getPieceCaptured() != null) {
pieces.remove(move.getPieceCaptured());
}
// Update the moved piece's position
piece.setPosition(move.getToX(), move.getToY());
// Save move in history for undo
moveHistory.add(move);
// Switch turn
turnWhite = !turnWhite;
turnNumber++;
// Clear selection/highlight
selected = null;
highlighted.clear();
}
}