Package tech.underoaks.coldcase.state
Class InteractionChain
java.lang.Object
tech.underoaks.coldcase.state.InteractionChain
Represents a sequence of interactions resulting from a player's action.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAction(Interaction interaction) Adds an interaction to be executed by theGameControllervoidAdds aGameStateUpdateto the interactions chain.voidaddRemoteAction(Interaction interaction) Adds a remote interaction to be executed by theGameControllerremotelyGets everyGameStateUpdatethat has been successfully simulated in this Chain.Gets every localInteractionthat still needs to be simulated before approval.Gets every remoteInteractionthat still needs to be simulated before approval.Get the currently used Deep-Clone of aMap.
-
Constructor Details
-
InteractionChain
Default-Constructor- Parameters:
snapshot- Deep-Clone of aMapthat will be the Basis of this Simulation.
-
-
Method Details
-
getSnapshot
Get the currently used Deep-Clone of aMap.- Returns:
- The current
Snapshot
-
addAction
Adds an interaction to be executed by theGameController- Parameters:
interaction- The interaction to add.
-
addRemoteAction
Adds a remote interaction to be executed by theGameControllerremotely- Parameters:
interaction- The interaction to add.
-
addGameStateUpdate
Adds aGameStateUpdateto the interactions chain.- Parameters:
gsu- The GameStateUpdate to add.- Throws:
GameStateUpdateException- If the update has failed.
-
getGSUQueue
Gets everyGameStateUpdatethat has been successfully simulated in this Chain.- Returns:
- Every queued
GameStateUpdate.
-
getPendingActions
Gets every localInteractionthat still needs to be simulated before approval.- Returns:
- Every queued local
Interaction.
-
getPendingRemoteActions
Gets every remoteInteractionthat still needs to be simulated before approval.- Returns:
- Every queued remote
Interaction.
-