StateMachine <TPossibleStates, TData>
Constructors
- new StateMachine<TPossibleStates, TData>(): StateMachine<TPossibleStates, TData>
Type parameters
- TPossibleStates: string
- TData
Returns StateMachine<TPossibleStates, TData>
Properties
states
: Map<string, State> = ...Accessors
- get currentState(): State
- set currentState(state: State): void
Methods
- go(stateName: TPossibleStates, eventData?: any): boolean
Parameters
stateName: TPossibleStates
optionaleventData: any
Returns boolean
- in(state: TPossibleStates): boolean
Parameters
Returns boolean
- restore(saveKey: string): void
- save(saveKey: string): void
- update(elapsedMs: number): void
Type parameters
Parameters
machineDescription: TMachine
optionaldata: TData