Class PlayableGameState

Direct Known Subclasses:
WaitingForMoveGameState, WaitingForRollGameState

public abstract class PlayableGameState extends OngoingGameState
A game state where we are waiting for interactions from a player.
  • Constructor Details

    • PlayableGameState

      public PlayableGameState(Board board, PlayerState lightPlayer, PlayerState darkPlayer, long timeSinceGameStartMs, PlayerType turn)
      Instantiates a game state for an ongoing point in a game.
      Parameters:
      board - The state of the pieces on the board.
      lightPlayer - The state of the light player.
      darkPlayer - The state of the dark player.
      timeSinceGameStartMs - The time this state was created.
      turn - The player who made an action or that should make an action.
  • Method Details

    • isPlayable

      public boolean isPlayable()
      Description copied from class: GameState
      Returns whether this state is a valid state to be played from.
      Specified by:
      isPlayable in class GameState
      Returns:
      Whether this state is a valid state to be played from.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class OngoingGameState