diff --git a/src/backend/Board.java b/src/backend/Board.java index efd8040..0aad278 100644 --- a/src/backend/Board.java +++ b/src/backend/Board.java @@ -38,8 +38,16 @@ public class Board { } 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() { // Place Rooks