Package net.royalur.rules.state
Class PlayableGameState
java.lang.Object
net.royalur.rules.state.GameState
net.royalur.rules.state.OngoingGameState
net.royalur.rules.state.PlayableGameState
- Direct Known Subclasses:
WaitingForMoveGameState
,WaitingForRollGameState
A game state where we are waiting for interactions from a player.
-
Constructor Summary
ConstructorDescriptionPlayableGameState
(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
describe, getBoard, getDarkPlayer, getLightPlayer, getPlayerState, getTimeSinceGameStartMs
-
Constructor Details
-
PlayableGameState
public PlayableGameState(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
-