Drag[en]gine Script Module DragonScript  1.21
Dragengine.StateMachineSystem.SMTransition Class Reference

State machine transition. More...

Inheritance diagram for Dragengine.StateMachineSystem.SMTransition:

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...
 

Detailed Description

State machine transition.

Transitions run a set of actions before activating the new state in the state machine.

Member Function Documentation

◆ addAction()

void Dragengine.StateMachineSystem.SMTransition.addAction ( SMStateAction  action)

Add action.

◆ addCondition()

void Dragengine.StateMachineSystem.SMTransition.addCondition ( String  condition)

Add condition.

◆ evaluateConditions()

bool Dragengine.StateMachineSystem.SMTransition.evaluateConditions ( SMContext  context)

Evaluate all conditions.

If no condition is present true is returned.

Parameters
parametersDictionary with parameters of type String key and String value. Do not change the content of the dictionary as it is shared.

◆ forEachAction()

void Dragengine.StateMachineSystem.SMTransition.forEachAction ( Block  ablock)

Visit actions with block with parameter SMStateAction.

◆ forEachCondition()

void Dragengine.StateMachineSystem.SMTransition.forEachCondition ( Block  ablock)

Visit conditions with block with parameter String.

◆ getActionAt()

SMStateAction Dragengine.StateMachineSystem.SMTransition.getActionAt ( int  index)

Get action at index.

◆ getActionCount()

int Dragengine.StateMachineSystem.SMTransition.getActionCount ( )

Count of actions.

◆ getEvent()

String Dragengine.StateMachineSystem.SMTransition.getEvent ( )

Identifier of event triggering transition.

◆ getParameters()

Dictionary Dragengine.StateMachineSystem.SMTransition.getParameters ( )

Parameters as Dictionary of type String key and String value.

Warning
Do not change the content of the dictionary as it is shared.

◆ getState()

SMState Dragengine.StateMachineSystem.SMTransition.getState ( )

State to switch to or null if not cached.

◆ getStateID()

String Dragengine.StateMachineSystem.SMTransition.getStateID ( )

Identifier of state to switch to or null to stay in the same state.

◆ matches()

bool Dragengine.StateMachineSystem.SMTransition.matches ( SMContext  context,
String  event 
)

Transition matches event and condition is true.

◆ new() [1/2]

SMTransition Dragengine.StateMachineSystem.SMTransition.new ( String  event)

Create state machine transition staying in the same state.

Parameters
eventEvent to react to.

◆ new() [2/2]

SMTransition Dragengine.StateMachineSystem.SMTransition.new ( String  event,
String  stateID 
)

Create state machine transition.

Parameters
eventEvent to react to.
stateIDState to switch to or null to stay in the same state.

◆ run()

void Dragengine.StateMachineSystem.SMTransition.run ( SMContext  context)

Run transition.


The documentation for this class was generated from the following file: