Class ActionGameState

Direct Known Subclasses:
MovedGameState, RolledGameState

public abstract class ActionGameState extends OngoingGameState
A game state that is included in the middle of a game to record an action that was taken, but that is not a valid state to be in.
  • Constructor Details

    • ActionGameState

      public ActionGameState(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