Alright
This commit is contained in:
parent
ceaad980f6
commit
0bf99a6157
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue