iswhite method

This commit is contained in:
hugomanipoud2 2025-05-09 09:46:47 +02:00
parent f01cc5d127
commit b6d66394af
1 changed files with 4 additions and 2 deletions

View File

@ -5,11 +5,13 @@ public class Piece {
private int x;
private int y;
private PieceType type;
private Boolean color;
public Piece(int xCoord, int yCoord, PieceType typeConstructor) {
public Piece(int xCoord, int yCoord, PieceType typeConstructor, boolean colorConstructor) {
this.x = xCoord;
this.y = yCoord;
this.type = typeConstructor;
this.color = colorConstructor;
}
public int getX() {
return x;
@ -24,7 +26,7 @@ public class Piece {
}
public boolean isWhite() {
return false;
return color;
}
}