This commit is contained in:
Jacob Signorovitch
2025-04-24 14:52:21 -04:00
parent b6746d16a4
commit 187b0bf570
3 changed files with 9 additions and 6 deletions

View File

@@ -2,8 +2,8 @@ package chess;
// An actor is an entity capable of making descisions on the board. // An actor is an entity capable of making descisions on the board.
abstract class Actor { 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 }

View File

@@ -16,8 +16,8 @@ class Coord {
// Return coordinates relative to the selected color's position on the // Return coordinates relative to the selected color's position on the
// board. White on top, black on bottom. // board. White on top, black on bottom.
Coord rel(ActorCol col) { Coord rel(Util.Col col) {
return col.equals(ActorCol.BLACK) return col.equals(Util.Col.BLACK)
? new Coord(this.x, Util.boardW - this.y) ? new Coord(this.x, Util.boardW - this.y)
: this; : this;
} }

View File

@@ -4,4 +4,7 @@ package chess;
class Util { class Util {
// Width of a chessboard. // Width of a chessboard.
static int boardW = 8; static int boardW = 8;
// The color a piece can be.
enum Col { WHITE, BLACK }
} }