|
Drag[en]gine Script Module DragonScript 1.32.1
|
State machine state. More...
Public Member Functions | |
| void | addEnterAction (SMStateAction action) |
| Add enter action. | |
| void | addExitAction (SMStateAction action) |
| Add exit action. | |
| void | addTransition (SMTransition transition) |
| Add transition. | |
| SMStateAction | findEnterAction (Block ablock) |
| Find enter action with block with parameter SMStateAction. | |
| SMStateAction | findExitAction (Block ablock) |
| Find exit action with block with parameter SMStateAction. | |
| SMTransition | findTransition (Block ablock) |
| Find transition with block with parameter SMTransition. | |
| void | forEachEnterAction (Block ablock) |
| Visit enter actions with block with parameter SMStateAction. | |
| void | forEachExitAction (Block ablock) |
| Visit exit actions with block with parameter SMStateAction. | |
| void | forEachTransition (Block ablock) |
| Visit transitions with block with parameter SMTransition. | |
| SMStateAction | getEnterActionAt (int index) |
| Get enter action at index. | |
| int | getEnterActionCount () |
| Count of enter actions. | |
| SMStateAction | getExitActionAt (int index) |
| Get exit action at index. | |
| int | getExitActionCount () |
| Count of exit actions. | |
| String | getID () |
| Unique state identifier or null. | |
| String | getNextStateID () |
| State to transition to after all enter actions finished or null. | |
| SMTransition | getTransitionAt (int index) |
| Get transition at index. | |
| int | getTransitionCount () |
| Count of transitions. | |
| void | importState (SMState state) |
| Import state. | |
| int | indexOfEnterAction (SMStateAction action) |
| Index of enter action or -1 if absent. | |
| int | indexOfExitAction (SMStateAction action) |
| Index of exit action or -1 if absent. | |
| int | indexOfTransition (SMTransition transition) |
| Index of transition or -1 if absent. | |
| SMState | new (SMState state) |
| Create copy of state machine state. | |
| SMState | new (String id) |
| Create state machine state. | |
| void | removeAllTransitions () |
| Remove all transitions. | |
| void | removeTransition (SMTransition transition) |
| Remove transition. | |
| void | setNextStateID (String id) |
| Set state to transition to after all enter actions finished or null. | |
Public Attributes | |
| Array | pEnterActions |
| Array | pExitActions |
| String | pID |
| String | pNextStateID |
| Array | pTransitions |
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.
| SMStateAction Dragengine.StateMachineSystem.SMState.findEnterAction | ( | Block | ablock | ) |
Find enter action with block with parameter SMStateAction.
| SMStateAction Dragengine.StateMachineSystem.SMState.findExitAction | ( | Block | ablock | ) |
Find exit action with block with parameter SMStateAction.
| SMTransition Dragengine.StateMachineSystem.SMState.findTransition | ( | Block | ablock | ) |
Find transition with block with parameter SMTransition.
| 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.
| SMStateAction Dragengine.StateMachineSystem.SMState.getExitActionAt | ( | int | index | ) |
Get exit action at index.
| int Dragengine.StateMachineSystem.SMState.getExitActionCount | ( | ) |
Count of exit actions.
| String Dragengine.StateMachineSystem.SMState.getID | ( | ) |
Unique state identifier or null.
| String Dragengine.StateMachineSystem.SMState.getNextStateID | ( | ) |
State to transition to after all enter actions finished or null.
| SMTransition Dragengine.StateMachineSystem.SMState.getTransitionAt | ( | int | index | ) |
Get transition at index.
| int Dragengine.StateMachineSystem.SMState.getTransitionCount | ( | ) |
Count of transitions.
| void Dragengine.StateMachineSystem.SMState.importState | ( | SMState | state | ) |
Import state.
| 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.
Create copy of state machine state.
| state | State to copy. |
| 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.
| void Dragengine.StateMachineSystem.SMState.setNextStateID | ( | String | id | ) |
Set state to transition to after all enter actions finished or null.
| Array Dragengine.StateMachineSystem.SMState.pEnterActions |
| Array Dragengine.StateMachineSystem.SMState.pExitActions |
| String Dragengine.StateMachineSystem.SMState.pID |
| String Dragengine.StateMachineSystem.SMState.pNextStateID |
| Array Dragengine.StateMachineSystem.SMState.pTransitions |