Constructor
new States(owner)
Creates a new instance of the States class, ie a state machine.
Parameters:
Name | Type | Description |
---|---|---|
owner |
Object | The state owner. |
- Source:
Members
(readonly) selected :rune.state.State
The state that is currently selected and thus activated.
Type:
- Source:
Methods
load(states) → {undefined}
Load a new batch of states. A "batch" is represented by a list.
Parameters:
Name | Type | Description |
---|---|---|
states |
Array.<rune.state.State> | List of instantiated states. |
- Source:
Throws:
-
If invalid or empty batch.
- Type
- Error
Returns:
- Type
- undefined
select(name) → {boolean}
Selects and activates a state based on its name.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Name of state to be selected. |
- Source:
Returns:
Whether a state could be selected.
- Type
- boolean