Package net.royalur.rules.state
Class ActionGameState
java.lang.Object
net.royalur.rules.state.GameState
net.royalur.rules.state.OngoingGameState
net.royalur.rules.state.ActionGameState
- Direct Known Subclasses:
MovedGameState
,RolledGameState
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 Summary
ConstructorsConstructorDescriptionActionGameState
(Board board, PlayerState lightPlayer, PlayerState darkPlayer, long timeSinceGameStartMs, PlayerType turn) Instantiates a game state for an ongoing point in a game. -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
Returns whether this state is a valid state to be played from.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, describe, getBoard, getDarkPlayer, getLightPlayer, getMetadata, getMetadata, getPlayerState, getTimeSinceGameStartMs, hasMetadata, removeMetadata
-
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 classGameState
- Returns:
- Whether this state is a valid state to be played from.
-
equals
- Overrides:
equals
in classOngoingGameState
-