deleted useless attributes + add new comments
This commit is contained in:
parent
b720024c15
commit
35660f9bbb
|
|
@ -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];
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue