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<TData>> = ...Accessors
- get currentState(): State<TData>
- set currentState(state: State<TData>): void
Returns State<TData>
Parameters
Returns 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(elapsed: number): void
Type parameters
Parameters
machineDescription: TMachine
optionaldata: TData