adding indexes to pieces to create disparate objects

This commit is contained in:
hugomanipoud2 2025-05-09 10:17:45 +02:00
parent b6d66394af
commit 8225151d90
2 changed files with 15 additions and 5 deletions

View File

@ -36,8 +36,8 @@ public class Board {
//TODO
}
public void populateBoard() {
//TODO
public void populateBoard(Piece piece) {
}
public void cleanBoard() {

View File

@ -5,28 +5,38 @@ public class Piece {
private int x;
private int y;
private PieceType type;
private Boolean color;
private boolean color;
private int index;
public Piece(int xCoord, int yCoord, PieceType typeConstructor, boolean colorConstructor) {
public Piece(int xCoord, int yCoord, PieceType typeConstructor, boolean colorConstructor, int indexPiece) {
this.x = xCoord;
this.y = yCoord;
this.type = typeConstructor;
this.color = colorConstructor;
this.index = indexPiece;
}
// ycoord of the piece
public int getX() {
return x;
}
//ycoord of the piece
public int getY() {
return y;
}
//type of the piece
public PieceType getType() {
return type;
}
//hypothetic color of the piece
public boolean isWhite() {
return color;
}
public int getIndex() {
return index;
}
}