end of piece constructor

This commit is contained in:
Alexandre ALTARIBA 2025-04-18 15:47:34 +02:00
parent 0f3e7f140c
commit f3b7983ba0
1 changed files with 12 additions and 3 deletions

View File

@ -4,10 +4,14 @@ public class Piece {
private int x;
private int y;
private char type;
private char color;
public Piece(int xP, int yP) {
public Piece(int xP, int yP, char type_P, char color_P) {
x = xP;
y = yP;
type = type_P;
color = color_P;
}
public int getX() {
@ -19,11 +23,16 @@ public class Piece {
}
public PieceType getType() {
return null;
return PieceType.fromSummary(type);
}
public boolean isWhite() {
return false;
if(color =='w') {
return true;
}
else {
return false;
}
}
}