added isWhite, pieceType and getter of X and Y in piece

This commit is contained in:
carol 2025-04-17 10:59:53 +02:00
parent a062e55489
commit dc00037eaa
1 changed files with 18 additions and 4 deletions

View File

@ -1,21 +1,35 @@
package backend; package backend;
public class Piece { public class Piece {
private int x;
private int y;
private boolean isWhite;
private PieceType type;
public Piece(int x, int y, boolean isWhite, PieceType type) {
this.x = x;
this.y = y;
this.isWhite = isWhite;
this.type = type;
}
public int getX() { public int getX() {
return 0; return x;
} }
public int getY() { public int getY() {
return 0; return y;
} }
public PieceType getType() { public PieceType getType() {
return null;
return type;
} }
public boolean isWhite() { public boolean isWhite() {
return false;
return isWhite;
} }
} }