diff --git a/src/backend/Board.java b/src/backend/Board.java index de42b14..2cb0b84 100644 --- a/src/backend/Board.java +++ b/src/backend/Board.java @@ -3,7 +3,6 @@ package backend; import java.util.ArrayList; public class Board { - private String boardString; // Represent the board's state as a string private int line; private int col; private Piece[][] board; // 2D array to hold pieces @@ -123,7 +122,6 @@ public class Board { } public void userTouch(int x, int y) { - //TODO // Case 1: No position is selected if (selectedPosition==null) { Piece clickedPiece = board[y][x]; @@ -159,6 +157,8 @@ public class Board { } public void movePiece(int fromX, int fromY, int toX, int toY) { + // Additional method: moves a piece from one position to another on the board + // Get the piece at the source position Piece piece = board[fromY][fromX]; diff --git a/src/backend/Piece.java b/src/backend/Piece.java index b9dc622..adf684a 100644 --- a/src/backend/Piece.java +++ b/src/backend/Piece.java @@ -22,6 +22,7 @@ public class Piece { return color; } + // Additional methods: updates the x or y coordinates of the piece's position on the board public void setX(int x) { this.X=x; }