new piece const

This commit is contained in:
cleme 2025-04-10 10:42:39 +02:00
parent 0929ec59a4
commit e06be13a00
1 changed files with 4 additions and 13 deletions

View File

@ -3,10 +3,10 @@ package backend;
public class Piece {
private int x;
private int y;
private ChessPieceType type;
private PieceType type;
private boolean isWhite;
public Piece(int x, int y, ChessPieceType type, boolean isWhite) {
public Piece(int x, int y, PieceType type, boolean isWhite) {
this.x = x;
this.y = y;
this.type = type;
@ -21,20 +21,11 @@ public class Piece {
return y;
}
public ChessPieceType getType() {
public PieceType getType() {
return type;
}
public boolean isWhite() {
return isWhite; // Returns true if the piece is white, false if black
}
}
enum ChessPieceType {
Pawn,
Rook,
Knight,
Bishop,
Queen,
King,
}
}