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.
  • BoardState contains 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 some byte[] arrays tracking the position indexes of the queens.
  • State contains a more complete game state. It has the same fields as BoardState, but also tracks which player moves next, the most recent move taken, and contains methods to generate child states.
  • Move contains a set of methods used for working with moves, which are encoded as ints.
  • KGraph and QGraph contain 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.
  • Classes
    Class
    Description
    Represents 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 vertices v and u are 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 vertices v and u are 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.