placement of new pieces

This commit is contained in:
flori 2025-05-06 14:22:16 +02:00
parent 2b5e128809
commit c96ddc3cd7
1 changed files with 9 additions and 1 deletions

View File

@ -38,8 +38,16 @@ public class Board {
} }
public void setPiece(boolean isWhite, PieceType type, int x, int y) { public void setPiece(boolean isWhite, PieceType type, int x, int y) {
//TODO // Ensure coordinates are inside the board boundaries
// if (x < 0 || x >= width || y < 0 || y >= height) {
// System.out.println("Invalid coordinates: (" + x + ", " + y + ")");
// return;
// }
// Create and place the new piece
board[x][y] = new Piece(isWhite, type, x, y);
} }
public void populateBoard() { public void populateBoard() {
// Place Rooks // Place Rooks