Package net.royalur.notation
Class DerivedStateSource
java.lang.Object
net.royalur.notation.StateSource
net.royalur.notation.DerivedStateSource
Produces game states from previous game states using the actions
that were taken in a game. This effectively simulates games and
uses saved information to fill in the gaps and as a sanity check.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateAbandonedState
(RuleSet rules, long timeSinceGameStartMs, AbandonReason reason, PlayerType player) createEndState
(RuleSet rules, long timeSinceGameStartMs, PlayerType winner) createMovedState
(RuleSet rules, long timeSinceGameStartMs, PlayerType turn, Roll roll, Move move) createResignedState
(RuleSet rules, long timeSinceGameStartMs, PlayerType player) createRolledState
(RuleSet rules, long timeSinceGameStartMs, PlayerType turn, Roll roll) createWaitingForMoveState
(RuleSet rules, long timeSinceGameStartMs, PlayerType turn, Roll roll) createWaitingForRollState
(RuleSet rules, long timeSinceGameStartMs, PlayerType turn) int
lastIndexOf
(GameState state)
-
Constructor Details
-
DerivedStateSource
-
-
Method Details
-
getAllStates
-
lastIndexOf
-
createRolledState
public RolledGameState createRolledState(RuleSet rules, long timeSinceGameStartMs, PlayerType turn, Roll roll) - Specified by:
createRolledState
in classStateSource
-
createMovedState
public MovedGameState createMovedState(RuleSet rules, long timeSinceGameStartMs, PlayerType turn, Roll roll, Move move) - Specified by:
createMovedState
in classStateSource
-
createWaitingForRollState
public WaitingForRollGameState createWaitingForRollState(RuleSet rules, long timeSinceGameStartMs, PlayerType turn) - Specified by:
createWaitingForRollState
in classStateSource
-
createWaitingForMoveState
public WaitingForMoveGameState createWaitingForMoveState(RuleSet rules, long timeSinceGameStartMs, PlayerType turn, Roll roll) - Specified by:
createWaitingForMoveState
in classStateSource
-
createResignedState
public ResignedGameState createResignedState(RuleSet rules, long timeSinceGameStartMs, PlayerType player) - Specified by:
createResignedState
in classStateSource
-
createAbandonedState
public AbandonedGameState createAbandonedState(RuleSet rules, long timeSinceGameStartMs, AbandonReason reason, @Nullable PlayerType player) - Specified by:
createAbandonedState
in classStateSource
-
createEndState
public EndGameState createEndState(RuleSet rules, long timeSinceGameStartMs, @Nullable PlayerType winner) - Specified by:
createEndState
in classStateSource
-