Package net.royalur.rules.state
Class MovedGameState
java.lang.Object
net.royalur.rules.state.GameState
net.royalur.rules.state.OngoingGameState
net.royalur.rules.state.ActionGameState
net.royalur.rules.state.MovedGameState
A game state that represents a move of a piece on the board.
-
Constructor Summary
ConstructorsConstructorDescriptionMovedGameState
(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. -
Method Summary
Methods inherited from class net.royalur.rules.state.ActionGameState
isPlayable
Methods inherited from class net.royalur.rules.state.OngoingGameState
getSubject, getTurn, getTurnPlayer, getWaiting, getWaitingPlayer, isFinished
Methods inherited from class net.royalur.rules.state.GameState
addMetadata, addMetadata, clearMetadata, getBoard, getDarkPlayer, getLightPlayer, getMetadata, getMetadata, getPlayerState, getTimeSinceGameStartMs, hasMetadata, removeMetadata
-
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
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
Gets the move that was made.- Returns:
- The move that was made.
-
describe
Description copied from class:GameState
Generates an English text description of the state of the game. -
equals
- Overrides:
equals
in classActionGameState
-