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

11 months ago
public class Square {
//Pawn, knight, bishop, rook, queen, king, blank.
11 months ago
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;
11 months ago
//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
11 months ago
public Square(int type) {
this(type, false);
}
public Square(int type, boolean isWhite) {
this.type = type;
this.isWhite = isWhite;
}
11 months ago
//Positive values for white, negative for black, blank square is 0.
public int getValue() {
11 months ago
return 0; //TODO.
11 months ago
}
11 months ago
public int getType() {
return type;
}
public boolean isWhite() {
return isWhite;
}
11 months ago
}