Class RolledGameState


public class RolledGameState extends ActionGameState
A game state that represents a roll that was made in a game.
  • Constructor Details

    • RolledGameState

      public RolledGameState(Board board, PlayerState lightPlayer, PlayerState darkPlayer, long timeSinceGameStartMs, PlayerType turn, Roll roll, List<Move> availableMoves)
      Instantiates a game state that represents a roll 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 can roll the dice.
      roll - The value of the dice that was rolled that can be used as the number of places to move a piece.
      availableMoves - The moves that are available from this position using the given roll.
  • Method Details

    • getRoll

      public Roll getRoll()
      Gets the roll that the player made.
      Returns:
      The roll that the player made.
    • getAvailableMoves

      public List<Move> getAvailableMoves()
      Gets the moves that are available from this position using the given roll.
      Returns:
      The moves that are available from this position using the given roll.
    • 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