Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.StateMachineSystem.StateMachine Class Reference

State machine. More...

Inheritance diagram for Dragengine.StateMachineSystem.StateMachine:

Public Member Functions

void addState (SMState state)
 Add state.
void addStateReplace (SMState state)
 Add state replacing existing one if present.
void addTransition (SMTransition transition)
 Add transition.
SMTransition findTransition (Block ablock)
 Find transition with block with parameter SMTransition.
void forEachState (Block ablock)
 Visit states with block.
void forEachTransition (Block ablock)
 Visit transitions with block with parameter SMTransition.
String getFilename ()
 Filename or null.
String getInitialState ()
 Initial state or null if not set.
SMState getStateAt (String id)
 State with identifier or null if absent.
int getStateCount ()
 Count of states.
SMTransition getTransitionAt (int index)
 Get transition at index.
int getTransitionCount ()
 Count of transitions.
bool hasStateAt (String id)
 State with identifier is present.
int indexOfTransition (SMTransition transition)
 Index of transition or -1 if absent.
StateMachine new ()
 Create state machine.
StateMachine new (String filename)
 Create state machine with filename.
void removeAllTransitions ()
 Remove all transitions.
void removeState (SMState state)
 Remove state.
void removeTransition (SMTransition transition)
 Remove transition.
void setInitialState (String initialState)
 Set initial state.

Static Public Member Functions

static StateMachine newEmpty ()
 Create state machine with empty state.

Public Attributes

String pFilename
String pInitialState
Dictionary pStates
Array pTransitions

Detailed Description

State machine.

Member Function Documentation

◆ addState()

void Dragengine.StateMachineSystem.StateMachine.addState ( SMState state)

Add state.

Exceptions
EInvalidParamAnother state with the same identifier is present.

References getStateAt(), and pStates.

Referenced by getInitialState().

◆ addStateReplace()

void Dragengine.StateMachineSystem.StateMachine.addStateReplace ( SMState state)

Add state replacing existing one if present.

Version
1.26

Referenced by getTransitionAt().

◆ addTransition()

void Dragengine.StateMachineSystem.StateMachine.addTransition ( SMTransition transition)

Add transition.

Version
1.35

References pInitialState, and setInitialState().

Referenced by findTransition().

◆ findTransition()

SMTransition Dragengine.StateMachineSystem.StateMachine.findTransition ( Block ablock)

◆ forEachState()

void Dragengine.StateMachineSystem.StateMachine.forEachState ( Block ablock)

Visit states with block.

Version
1.26

Block has signature (SMState).

References hasStateAt(), and pStates.

Referenced by removeState().

◆ forEachTransition()

void Dragengine.StateMachineSystem.StateMachine.forEachTransition ( Block ablock)

Visit transitions with block with parameter SMTransition.

Version
1.35

References getTransitionCount(), and pTransitions.

Referenced by findTransition().

◆ getFilename()

String Dragengine.StateMachineSystem.StateMachine.getFilename ( )

Filename or null.

Version
1.26

References removeState().

Referenced by removeAllTransitions().

◆ getInitialState()

String Dragengine.StateMachineSystem.StateMachine.getInitialState ( )

Initial state or null if not set.

References addState().

Referenced by indexOfTransition().

◆ getStateAt()

SMState Dragengine.StateMachineSystem.StateMachine.getStateAt ( String id)

State with identifier or null if absent.

References getStateCount(), and pStates.

Referenced by addState().

◆ getStateCount()

int Dragengine.StateMachineSystem.StateMachine.getStateCount ( )

Count of states.

Referenced by getStateAt().

◆ getTransitionAt()

SMTransition Dragengine.StateMachineSystem.StateMachine.getTransitionAt ( int index)

Get transition at index.

Version
1.35

References addStateReplace(), and pStates.

Referenced by findTransition().

◆ getTransitionCount()

int Dragengine.StateMachineSystem.StateMachine.getTransitionCount ( )

Count of transitions.

Version
1.35

References pStates.

Referenced by forEachTransition().

◆ hasStateAt()

bool Dragengine.StateMachineSystem.StateMachine.hasStateAt ( String id)

State with identifier is present.

References pFilename.

Referenced by forEachState().

◆ indexOfTransition()

int Dragengine.StateMachineSystem.StateMachine.indexOfTransition ( SMTransition transition)

Index of transition or -1 if absent.

Version
1.35

References getInitialState().

Referenced by findTransition().

◆ new() [1/2]

StateMachine Dragengine.StateMachineSystem.StateMachine.new ( )

Create state machine.

References new(), pStates, and pTransitions.

Referenced by new().

◆ new() [2/2]

StateMachine Dragengine.StateMachineSystem.StateMachine.new ( String filename)

Create state machine with filename.

Version
1.26

◆ newEmpty()

StateMachine Dragengine.StateMachineSystem.StateMachine.newEmpty ( )
static

Create state machine with empty state.

References newEmpty().

Referenced by newEmpty().

◆ removeAllTransitions()

void Dragengine.StateMachineSystem.StateMachine.removeAllTransitions ( )

Remove all transitions.

Version
1.35

References getFilename(), and pFilename.

Referenced by findTransition().

◆ removeState()

void Dragengine.StateMachineSystem.StateMachine.removeState ( SMState state)

Remove state.

Version
1.26

References forEachState(), and pStates.

Referenced by getFilename().

◆ removeTransition()

void Dragengine.StateMachineSystem.StateMachine.removeTransition ( SMTransition transition)

Remove transition.

Version
1.35

Referenced by findTransition().

◆ setInitialState()

void Dragengine.StateMachineSystem.StateMachine.setInitialState ( String initialState)

Set initial state.

References pStates.

Referenced by addTransition().

Member Data Documentation

◆ pFilename

String Dragengine.StateMachineSystem.StateMachine.pFilename

Referenced by hasStateAt(), and removeAllTransitions().

◆ pInitialState

String Dragengine.StateMachineSystem.StateMachine.pInitialState

Referenced by addTransition().

◆ pStates

Dictionary Dragengine.StateMachineSystem.StateMachine.pStates

◆ pTransitions

Array Dragengine.StateMachineSystem.StateMachine.pTransitions

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