Updated.
This commit is contained in:
@@ -2,8 +2,8 @@ package chess;
|
||||
|
||||
// An actor is an entity capable of making descisions on the board.
|
||||
abstract class Actor {
|
||||
ActorCol col;
|
||||
Util.Col col; // The color the Actor is acting as.
|
||||
Boolean inCheck; // Whether the Actor is currently in check.
|
||||
Boolean canCastle; // Whether the Actor can castle.
|
||||
Boolean won; // Whether the Actor has won.
|
||||
}
|
||||
|
||||
// The color an Actor may assume.
|
||||
enum ActorCol { WHITE, BLACK }
|
||||
|
@@ -16,8 +16,8 @@ class Coord {
|
||||
|
||||
// Return coordinates relative to the selected color's position on the
|
||||
// board. White on top, black on bottom.
|
||||
Coord rel(ActorCol col) {
|
||||
return col.equals(ActorCol.BLACK)
|
||||
Coord rel(Util.Col col) {
|
||||
return col.equals(Util.Col.BLACK)
|
||||
? new Coord(this.x, Util.boardW - this.y)
|
||||
: this;
|
||||
}
|
||||
|
@@ -4,4 +4,7 @@ package chess;
|
||||
class Util {
|
||||
// Width of a chessboard.
|
||||
static int boardW = 8;
|
||||
|
||||
// The color a piece can be.
|
||||
enum Col { WHITE, BLACK }
|
||||
}
|
||||
|
Reference in New Issue
Block a user