Package net.royalur.rules.state
Class OngoingGameState
java.lang.Object
net.royalur.rules.state.GameState
net.royalur.rules.state.OngoingGameState
- Direct Known Subclasses:
ActionGameState
,PlayableGameState
A game state from within a game where a winner has not yet been determined.
-
Constructor Summary
ConstructorDescriptionOngoingGameState
(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
Get the subject player of the game state.getTurn()
Gets the player who can make the next interaction with the game.Gets the state of the player that we are waiting on to interact with the game.Gets the player that is waiting whilst the other player makes the next interaction with the game.Gets the state of the player that is waiting whilst the other player makes the next interaction with the game.boolean
Returns whether this state represents a finished game.Methods inherited from class net.royalur.rules.state.GameState
describe, getBoard, getDarkPlayer, getLightPlayer, getPlayerState, getTimeSinceGameStartMs, isPlayable
-
Constructor Details
-
OngoingGameState
public OngoingGameState(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
-
isFinished
public boolean isFinished()Description copied from class:GameState
Returns whether this state represents a finished game.- Specified by:
isFinished
in classGameState
- Returns:
- Whether this state represents a finished game.
-
getTurn
Gets the player who can make the next interaction with the game.- Returns:
- The player who can make the next interaction with the game.
-
getWaiting
Gets the player that is waiting whilst the other player makes the next interaction with the game.- Returns:
- The player who is waiting for the other player to interact with the game.
-
getTurnPlayer
Gets the state of the player that we are waiting on to interact with the game.- Returns:
- The state of the player that we are waiting on to interact with the game.
-
getWaitingPlayer
Gets the state of the player that is waiting whilst the other player makes the next interaction with the game.- Returns:
- The state of the player that is waiting for the other player to interact with the game.
-
getSubject
Description copied from class:GameState
Get the subject player of the game state. e.g., player to roll/move, player that rolled/moved, player that won.- Specified by:
getSubject
in classGameState
-
equals
-