Class StateSystem

All Implemented Interfaces:
Disposable, KryoSerializable
Direct Known Subclasses:
GameStateSystem

public class StateSystem extends GameSystem
  • Field Details

    • updateRequired

      public boolean updateRequired
    • replayRecord

      public ReplayManager.ReplayRecord replayRecord
    • duplicateActionsTo

      public StateSystem duplicateActionsTo
    • inUpdateStage

      public boolean inUpdateStage
      If this flag is set to false, many state-affecting methods will throw an exception on call to prevent desync. Only set it to true before manipulating the state if you are sure it will not cause desync / full sync is not needed. This flag is set to true at the start of each frame update and gets reset to false at the end, to make sure all changes to the state are caused by state-affecting code and not something like UI events.
    • updateNumber

      public int updateNumber
    • replayMode

      public boolean replayMode
    • replayFrameCount

      public long replayFrameCount
  • Constructor Details

    • StateSystem

      public StateSystem()
  • Method Details

    • write

      public void write(Kryo kryo, Output output)
      Specified by:
      write in interface KryoSerializable
      Overrides:
      write in class Registrable
    • read

      public void read(Kryo kryo, Input input)
      Specified by:
      read in interface KryoSerializable
      Overrides:
      read in class Registrable
    • affectsGameState

      public boolean affectsGameState()
      Specified by:
      affectsGameState in class GameSystem
    • getSystemName

      public String getSystemName()
      Specified by:
      getSystemName in class GameSystem
    • isFastForwarding

      public boolean isFastForwarding()
    • getFastForwardUpdateNumber

      public int getFastForwardUpdateNumber()
    • startFastForwarding

      public void startFastForwarding(int toUpdateNumber)
    • stopFastForwarding

      public void stopFastForwarding()
    • checkGameplayUpdateAllowed

      public void checkGameplayUpdateAllowed()
      Вызывать для защиты от изменения геймплея не во время update
    • canSkipMediaUpdate

      public boolean canSkipMediaUpdate()
    • pushActionNextUpdate

      public void pushActionNextUpdate(Action action)
    • pushAction

      public void pushAction(Action action, int updateNumber)
    • requireUpdate

      public void requireUpdate()
    • dispose

      public void dispose()
      Description copied from interface: com.badlogic.gdx.utils.Disposable
      Releases all resources of this object.
      Specified by:
      dispose in interface Disposable
      Overrides:
      dispose in class GameSystem
    • getCurrentUpdateActions

      @Null public StateSystem.ActionsArray getCurrentUpdateActions()
      Returns:
      массив действий или null