Package ubc.team09.state
package ubc.team09.state
Game State Representation
This package contains the classes and methods used for representing the game state and generating child states. The more relevant classes are listed below.BoardStatecontains the minimal information of a board. Namely, a bitboard flagging each occupied square (a square is occupied if and only if it has either a queen or an arrow on it), and somebyte[]arrays tracking the position indexes of the queens.Statecontains a more complete game state. It has the same fields asBoardState, but also tracks which player moves next, the most recent move taken, and contains methods to generate child states.Movecontains a set of methods used for working with moves, which are encoded asints.KGraphandQGraphcontain operations that can be applied to board states and which model such states as graphs where edges are defined by king-move adjacency and queen move adjacency, respectively.
-
ClassesClassDescriptionRepresents a board state."C" for constants.This class includes operations that model the board state as a graph, where
- vertices are board positions, and
- two verticesvanduare adjacent if and only if a king could move from one to the other in a single move.
The king-move definition of edges is the reason for the "K" in the name.This class is used to handle moves on the board.This class includes operations that model the board state as a graph, where
- vertices are board positions, and
- two verticesvanduare adjacent if and only if a queen could move from one to the other in a single move.
The queen-move definition of edges is the reason for the "Q" in the name.Represents a complete game state.This class is used to iterate over child states, generating them on demand.