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
Constructors -
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) intlastIndexOf(GameState state)
-
Constructor Details
-
DerivedStateSource
-
-
Method Details
-
getAllStates
-
lastIndexOf
-
createRolledState
public RolledGameState createRolledState(RuleSet rules, long timeSinceGameStartMs, PlayerType turn, Roll roll) - Specified by:
createRolledStatein classStateSource
-
createMovedState
public MovedGameState createMovedState(RuleSet rules, long timeSinceGameStartMs, PlayerType turn, Roll roll, Move move) - Specified by:
createMovedStatein classStateSource
-
createWaitingForRollState
public WaitingForRollGameState createWaitingForRollState(RuleSet rules, long timeSinceGameStartMs, PlayerType turn) - Specified by:
createWaitingForRollStatein classStateSource
-
createWaitingForMoveState
public WaitingForMoveGameState createWaitingForMoveState(RuleSet rules, long timeSinceGameStartMs, PlayerType turn, Roll roll) - Specified by:
createWaitingForMoveStatein classStateSource
-
createResignedState
public ResignedGameState createResignedState(RuleSet rules, long timeSinceGameStartMs, PlayerType player) - Specified by:
createResignedStatein classStateSource
-
createAbandonedState
public AbandonedGameState createAbandonedState(RuleSet rules, long timeSinceGameStartMs, AbandonReason reason, @Nullable PlayerType player) - Specified by:
createAbandonedStatein classStateSource
-
createEndState
public EndGameState createEndState(RuleSet rules, long timeSinceGameStartMs, @Nullable PlayerType winner) - Specified by:
createEndStatein classStateSource
-