Drag[en]gine Script Module DragonScript
1.21
|
State machine state. More...
Public Member Functions | |
void | addEnterAction (SMStateAction action) |
Add enter action. More... | |
void | addExitAction (SMStateAction action) |
Add exit action. More... | |
void | addTransition (SMTransition transition) |
Add transition. More... | |
void | forEachEnterAction (Block ablock) |
Visit enter actions with block with parameter SMStateAction. More... | |
void | forEachExitAction (Block ablock) |
Visit exit actions with block with parameter SMStateAction. More... | |
void | forEachTransition (Block ablock) |
Visit transitions with block with parameter SMTransition. More... | |
SMStateAction | getEnterActionAt (int index) |
Get enter action at index. More... | |
int | getEnterActionCount () |
Count of enter actions. More... | |
String | getID () |
Unique state identifier or null. More... | |
int | indexOfEnterAction (SMStateAction action) |
Index of enter action or -1 if absent. More... | |
int | indexOfExitAction (SMStateAction action) |
Index of exit action or -1 if absent. More... | |
int | indexOfTransition (SMTransition transition) |
Index of transition or -1 if absent. More... | |
SMState | new (String id) |
Create state machine state. More... | |
void | removeAllTransitions () |
Remove all transitions. More... | |
void | removeTransition (SMTransition transition) |
Remove transition. More... | |
State machine state.
States contain a list of actions to do while entering or existing the state and a list of transitions triggered by events.
States are assigned a unique identifier. Strings are used instead of a number to make the state machine more portable across changing save state revisions.
Each state can have multiple transitions matching the same event by using conditions. The first transition matching the send event with fulfilled condition is selected. If no transition matches the event raises an exception.
Action can have optional condition running them only if the condition evaluates to true.
void Dragengine.StateMachineSystem.SMState.addEnterAction | ( | SMStateAction | action | ) |
Add enter action.
void Dragengine.StateMachineSystem.SMState.addExitAction | ( | SMStateAction | action | ) |
Add exit action.
void Dragengine.StateMachineSystem.SMState.addTransition | ( | SMTransition | transition | ) |
Add transition.
void Dragengine.StateMachineSystem.SMState.forEachEnterAction | ( | Block | ablock | ) |
Visit enter actions with block with parameter SMStateAction.
void Dragengine.StateMachineSystem.SMState.forEachExitAction | ( | Block | ablock | ) |
Visit exit actions with block with parameter SMStateAction.
void Dragengine.StateMachineSystem.SMState.forEachTransition | ( | Block | ablock | ) |
Visit transitions with block with parameter SMTransition.
SMStateAction Dragengine.StateMachineSystem.SMState.getEnterActionAt | ( | int | index | ) |
Get enter action at index.
int Dragengine.StateMachineSystem.SMState.getEnterActionCount | ( | ) |
Count of enter actions.
String Dragengine.StateMachineSystem.SMState.getID | ( | ) |
Unique state identifier or null.
int Dragengine.StateMachineSystem.SMState.indexOfEnterAction | ( | SMStateAction | action | ) |
Index of enter action or -1 if absent.
int Dragengine.StateMachineSystem.SMState.indexOfExitAction | ( | SMStateAction | action | ) |
Index of exit action or -1 if absent.
int Dragengine.StateMachineSystem.SMState.indexOfTransition | ( | SMTransition | transition | ) |
Index of transition or -1 if absent.
SMState Dragengine.StateMachineSystem.SMState.new | ( | String | id | ) |
Create state machine state.
id | Identifier or null. |
EInvalidParam | id is empty string. |
void Dragengine.StateMachineSystem.SMState.removeAllTransitions | ( | ) |
Remove all transitions.
void Dragengine.StateMachineSystem.SMState.removeTransition | ( | SMTransition | transition | ) |
Remove transition.