Class MovedGameState


public class MovedGameState extends ActionGameState
A game state that represents a move of a piece on the board.
  • Constructor Details

    • MovedGameState

      public MovedGameState(Board board, PlayerState lightPlayer, PlayerState darkPlayer, long timeSinceGameStartMs, PlayerType turn, Roll roll, Move move)
      Instantiates a game state representing a move that was made 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 the move.
      roll - The roll of the dice that was used to move the piece.
      move - The move that was made on the board.
  • Method Details

    • getRoll

      public Roll getRoll()
      Gets the roll of the dice that was used for the move.
      Returns:
      The roll of the dice that was used for the move.
    • getMove

      public Move getMove()
      Gets the move that was made.
      Returns:
      The move that was made.
    • describe

      public String describe()
      Description copied from class: GameState
      Generates an English text description of the state of the game.
      Specified by:
      describe in class GameState
      Returns:
      An English text description of the state of the game.
    • equals

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