Drag[en]gine Script Module DragonScript
1.23
|
State machine transition. More...
Classes | |
enum | ConditionMode |
Condition modes. More... | |
Public Member Functions | |
void | addAction (SMStateAction action) |
Add action. More... | |
void | addCondition (String condition) |
Add condition. More... | |
bool | evaluateConditions (SMContext context) |
Evaluate all conditions. More... | |
void | forEachAction (Block ablock) |
Visit actions with block with parameter SMStateAction. More... | |
void | forEachCondition (Block ablock) |
Visit conditions with block with parameter String. More... | |
SMStateAction | getActionAt (int index) |
Get action at index. More... | |
int | getActionCount () |
Count of actions. More... | |
String | getEvent () |
Identifier of event triggering transition. More... | |
Dictionary | getParameters () |
Parameters as Dictionary of type String key and String value. More... | |
SMState | getState () |
State to switch to or null if not cached. More... | |
String | getStateID () |
Identifier of state to switch to or null to stay in the same state. More... | |
bool | matches (SMContext context, String event) |
Transition matches event and condition is true. More... | |
SMTransition | new (String event) |
Create state machine transition staying in the same state. More... | |
SMTransition | new (String event, String stateID) |
Create state machine transition. More... | |
void | run (SMContext context) |
Run transition. More... | |
State machine transition.
Transitions run a set of actions before activating the new state in the state machine.
void Dragengine.StateMachineSystem.SMTransition.addAction | ( | SMStateAction | action | ) |
Add action.
void Dragengine.StateMachineSystem.SMTransition.addCondition | ( | String | condition | ) |
Add condition.
bool Dragengine.StateMachineSystem.SMTransition.evaluateConditions | ( | SMContext | context | ) |
Evaluate all conditions.
If no condition is present true is returned.
parameters | Dictionary with parameters of type String key and String value. Do not change the content of the dictionary as it is shared. |
void Dragengine.StateMachineSystem.SMTransition.forEachAction | ( | Block | ablock | ) |
Visit actions with block with parameter SMStateAction.
void Dragengine.StateMachineSystem.SMTransition.forEachCondition | ( | Block | ablock | ) |
Visit conditions with block with parameter String.
SMStateAction Dragengine.StateMachineSystem.SMTransition.getActionAt | ( | int | index | ) |
Get action at index.
int Dragengine.StateMachineSystem.SMTransition.getActionCount | ( | ) |
Count of actions.
String Dragengine.StateMachineSystem.SMTransition.getEvent | ( | ) |
Identifier of event triggering transition.
Dictionary Dragengine.StateMachineSystem.SMTransition.getParameters | ( | ) |
Parameters as Dictionary of type String key and String value.
SMState Dragengine.StateMachineSystem.SMTransition.getState | ( | ) |
State to switch to or null if not cached.
String Dragengine.StateMachineSystem.SMTransition.getStateID | ( | ) |
Identifier of state to switch to or null to stay in the same state.
bool Dragengine.StateMachineSystem.SMTransition.matches | ( | SMContext | context, |
String | event | ||
) |
Transition matches event and condition is true.
SMTransition Dragengine.StateMachineSystem.SMTransition.new | ( | String | event | ) |
Create state machine transition staying in the same state.
event | Event to react to. |
SMTransition Dragengine.StateMachineSystem.SMTransition.new | ( | String | event, |
String | stateID | ||
) |
Create state machine transition.
event | Event to react to. |
stateID | State to switch to or null to stay in the same state. |
void Dragengine.StateMachineSystem.SMTransition.run | ( | SMContext | context | ) |
Run transition.