new StateMachine(theStates)
Represents a State Machine.
Parameters:
Name | Type | Description |
---|---|---|
theStates |
Array.<HSM.State> | the states that compose the state machine. The first state is the initial state. |
- Source:
Methods
-
StateMachine#emit(event, dataopt)
-
Creates a new event an passes it to the top-level state machine for handling. Aliased as handleEvent for backwards compatibility.
Parameters:
Name Type Attributes Description event
string event to be handled data
<optional>
event parameters - Source:
-
StateMachine#init(dataopt)
-
initializes this state machine and set the current state to the initial state. Any nested state machines will also be initialized and set to their initial state.
Parameters:
Name Type Attributes Description data
<optional>
event parameters - Source: