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