Options
All
  • Public
  • Public/Protected
  • All
Menu

Class StateManager

This is the main state machine which drives the game states.

Hierarchy

  • StateManager

Index

Constructors

constructor

  • Parameters

    • app: any

    Returns StateManager

Methods

constructState

  • constructState(key: any): any
  • Constructs a new state or returns the instance from the cache

    Parameters

    • key: any

    Returns any

getCurrentState

  • getCurrentState(): any
  • Returns the current state

    Returns any

moveToState

  • moveToState(key: any, payload?: object): boolean
  • Moves to a given state

    Parameters

    • key: any

      State Key

    • Default value payload: object = {}

    Returns boolean

register

  • register(stateClass: any): void
  • Registers a new state class, should be a GameState derived class

    Parameters

    • stateClass: any

    Returns void