diff --git a/chess/src/chess/Actor.java b/chess/src/chess/Actor.java index f12fac4..884297d 100644 --- a/chess/src/chess/Actor.java +++ b/chess/src/chess/Actor.java @@ -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 } diff --git a/chess/src/chess/Board.java b/chess/src/chess/Board.java index 8092c8d..e3022bf 100644 --- a/chess/src/chess/Board.java +++ b/chess/src/chess/Board.java @@ -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; } diff --git a/chess/src/chess/Util.java b/chess/src/chess/Util.java index fa49665..d36886a 100644 --- a/chess/src/chess/Util.java +++ b/chess/src/chess/Util.java @@ -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 } }