You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
988 B
42 lines
988 B
|
|
public class Square {
|
|
//Pawn, knight, bishop, rook, queen, king, blank.
|
|
public static final int OUT_OF_BOUNDS = -1;
|
|
public static final int EMPTY = 0;
|
|
public static final int PAWN = 1;
|
|
public static final int KNIGHT = 2;
|
|
public static final int BISHOP = 3;
|
|
public static final int ROOK = 4;
|
|
public static final int QUEEN = 5;
|
|
public static final int KING = 6;
|
|
|
|
private int type; //one of the 8 constants above.
|
|
private boolean isWhite;
|
|
|
|
//en passant boolean flag (for the square that would be "captured")
|
|
//boolean Knowledge of whether or not this piece moved yet (for castling)
|
|
//boolean for off-the-board square
|
|
|
|
public Square(int type) {
|
|
this(type, false);
|
|
}
|
|
|
|
public Square(int type, boolean isWhite) {
|
|
this.type = type;
|
|
this.isWhite = isWhite;
|
|
}
|
|
|
|
//Positive values for white, negative for black, blank square is 0.
|
|
public int getValue() {
|
|
return 0; //TODO.
|
|
}
|
|
|
|
public int getType() {
|
|
return type;
|
|
}
|
|
|
|
public boolean isWhite() {
|
|
return isWhite;
|
|
}
|
|
|
|
} |