end of piece constructor
This commit is contained in:
parent
0f3e7f140c
commit
f3b7983ba0
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue