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

GameWorld Behavior adding support for behavior tree and state machine access. More...

Inheritance diagram for Dragengine.Scenery.GWBehaviorBTSM:
Dragengine.Scenery.DefaultGWBehavior Dragengine.Scenery.GWBehavior

Public Member Functions

void dispose ()
 Dispose of behavior.
void forEachBTAction (Block ablock)
 Visit behavior tree actions using block with parameters String name and BTAction action.
void forEachBTCondition (Block ablock)
 Visit behavior tree conditions using block with parameters String name and BTCondition condition.
void forEachSMAction (Block ablock)
 Visit state machine actions using block with parameters String name and SMAction action.
void forEachSMCondition (Block ablock)
 Visit state machine conditions using block with parameters String name and SMCondition condition.
BTAction getBTAction (String name)
 Behavior tree action for name or null if absent.
int getBTActionCount ()
 Count of behavior tree actions.
BTCondition getBTCondition (String name)
 Behavior tree condition for name or null if absent.
int getBTConditionCount ()
 Count of behavior tree conditions.
SMAction getSMAction (String name)
 State machine action for name or null if absent.
int getSMActionCount ()
 Count of state machine actions.
SMCondition getSMCondition (String name)
 State machine condition for name or null if absent.
int getSMConditionCount ()
 Count of state machine conditions.
bool hasBTAction (String name)
 Behavior tree action is present.
bool hasBTCondition (String name)
 Behavior tree condition is present.
bool hasSMAction (String name)
 State machine action is present.
bool hasSMCondition (String name)
 State machine condition is present.
void init (StubGameWorld stub)
 Initialize game world from stub.
GWBehaviorBTSM new (GameWorld gameWorld)
 Create element.
void registerReceiveEvents (ECBehaviorStateMachine.Instance stateMachine)
 Register state machine to receive events.
void removeAllBTActions ()
 Remove all behavior tree actions.
void removeAllBTConditions ()
 Remove all behavior tree conditions.
void removeAllSMActions ()
 Remove all state machine actions.
void removeAllSMConditions ()
 Remove all state machine conditions.
void removeBTAction (String name)
 Remove behavior tree action.
void removeBTCondition (String name)
 Remove behavior tree condition.
void removeSMAction (String name)
 Remove state machine action.
void removeSMCondition (String name)
 Remove state machine condition.
void runSMEvent (String event)
 Run event on registered state machines.
void setAction (String name, BTSMActionCondition action)
 Set state machine and behavior tree action.
void setActionCondition (String name, BTSMActionCondition actionCondition)
 Set state machine and behavior tree action and condition.
void setBTAction (String name, Block action)
 Set behavior tree action for name using block.
void setBTAction (String name, BTAction action)
 Set behavior tree action for name.
void setBTCondition (String name, Block condition)
 Set behavior tree condition for name using block.
void setBTCondition (String name, BTCondition condition)
 Set behavior tree condition for name.
void setCondition (String name, BTSMActionCondition condition)
 Set state machine and behavior tree condition.
void setSMAction (String name, Block action)
 Set state machine action for name using block.
void setSMAction (String name, SMAction action)
 Set state machine action for name.
void setSMCondition (String name, Block condition)
 Set state machine condition for name using block.
void setSMCondition (String name, SMCondition condition)
 Set state machine condition for name.
void unregisterReceiveEvents (ECBehaviorStateMachine.Instance stateMachine)
 Unregister state machine from receiving events.
Public Member Functions inherited from Dragengine.Scenery.DefaultGWBehavior
String getBehaviorID ()
 Unique identifier of behavior.
GameWorld getGameWorld ()
 Game world this behavior belongs to.
String getID ()
 Identifier.
void loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader)
 Load data of another behavior.
DefaultGWBehavior new (GameWorld gameWorld, String id)
 Create default behavior.
void postThink (float elapsed)
 Post thinking after physics processing is finished.
void readFromFile (PersistencyEnvironment env, FileReader reader)
 Read from file.
bool requiresPersistency ()
 Behavior requires readFromFile() and writeToFile() to be called.
bool requiresThink ()
 Behavior instance requires update(), think() and postThink() to be called.
bool supportsBehaviorID (String identifier)
 Behavior supports loading data of another behavior.
void think (float elapsed)
 Think about what to do for the next frame update.
void update (float elapsed)
 Frame update.
void writeToFile (PersistencyEnvironment env, FileWriter writer)
 Write to file.

Public Attributes

Dictionary pBTActions
SafeArray pReceiveEventsSMs

Additional Inherited Members

Protected Member Functions inherited from Dragengine.Scenery.DefaultGWBehavior
void setBehaviorID (String identifier)
 Set behavior identifier.
void setRequiresPersistency (bool required)
 Set if behavior requires readFromFile() and writeToFile() to be called.
void setRequiresThink (bool required)
 Set if behavior instance requires update(), think() and postThink() to be called.
void useClassNameAsBehaviorID ()
 Set behavior identifier to "<class-name>:<identifier>".
void useFullyQualifiedClassNameAsBehaviorID ()
 Set behavior identifier to "<fully-qualified-class-name>:<identifier>".

Detailed Description

GameWorld Behavior adding support for behavior tree and state machine access.

Version
1.35

Allows gameworld behaviors to add behavior tree and state machine actions and conditions that can be used by behavior trees and state machines of behavior elements.

This behavior can be present only once in a GameWorld.

See also
https://developer.dragondreams.ch/wiki/doku.php/dragengine:modules:dragonscript:gwbehavior_btsm

Member Function Documentation

◆ dispose()

void Dragengine.Scenery.GWBehaviorBTSM.dispose ( )

Dispose of behavior.

Reimplemented from Dragengine.Scenery.DefaultGWBehavior.

References pBTActions, and pReceiveEventsSMs.

Referenced by getBTCondition(), and setActionCondition().

◆ forEachBTAction()

void Dragengine.Scenery.GWBehaviorBTSM.forEachBTAction ( Block ablock)

Visit behavior tree actions using block with parameters String name and BTAction action.

References hasBTCondition().

Referenced by setSMAction().

◆ forEachBTCondition()

void Dragengine.Scenery.GWBehaviorBTSM.forEachBTCondition ( Block ablock)

Visit behavior tree conditions using block with parameters String name and BTCondition condition.

References setAction(), setBTAction(), and setSMAction().

Referenced by removeBTAction().

◆ forEachSMAction()

void Dragengine.Scenery.GWBehaviorBTSM.forEachSMAction ( Block ablock)

Visit state machine actions using block with parameters String name and SMAction action.

Referenced by runSMEvent().

◆ forEachSMCondition()

void Dragengine.Scenery.GWBehaviorBTSM.forEachSMCondition ( Block ablock)

Visit state machine conditions using block with parameters String name and SMCondition condition.

Referenced by runSMEvent().

◆ getBTAction()

BTAction Dragengine.Scenery.GWBehaviorBTSM.getBTAction ( String name)

Behavior tree action for name or null if absent.

References getBTConditionCount().

Referenced by getSMAction().

◆ getBTActionCount()

int Dragengine.Scenery.GWBehaviorBTSM.getBTActionCount ( )

Count of behavior tree actions.

Referenced by getSMActionCount().

◆ getBTCondition()

BTCondition Dragengine.Scenery.GWBehaviorBTSM.getBTCondition ( String name)

Behavior tree condition for name or null if absent.

References dispose().

Referenced by hasBTAction().

◆ getBTConditionCount()

int Dragengine.Scenery.GWBehaviorBTSM.getBTConditionCount ( )

Count of behavior tree conditions.

References pReceiveEventsSMs.

Referenced by getBTAction().

◆ getSMAction()

SMAction Dragengine.Scenery.GWBehaviorBTSM.getSMAction ( String name)

State machine action for name or null if absent.

References getBTAction().

Referenced by runSMEvent().

◆ getSMActionCount()

int Dragengine.Scenery.GWBehaviorBTSM.getSMActionCount ( )

Count of state machine actions.

References getBTActionCount(), and pBTActions.

Referenced by runSMEvent().

◆ getSMCondition()

SMCondition Dragengine.Scenery.GWBehaviorBTSM.getSMCondition ( String name)

State machine condition for name or null if absent.

References new().

Referenced by runSMEvent().

◆ getSMConditionCount()

int Dragengine.Scenery.GWBehaviorBTSM.getSMConditionCount ( )

Count of state machine conditions.

References new().

Referenced by runSMEvent().

◆ hasBTAction()

bool Dragengine.Scenery.GWBehaviorBTSM.hasBTAction ( String name)

Behavior tree action is present.

References getBTCondition().

Referenced by hasSMAction().

◆ hasBTCondition()

bool Dragengine.Scenery.GWBehaviorBTSM.hasBTCondition ( String name)

Behavior tree condition is present.

References init(), and setAction().

Referenced by forEachBTAction().

◆ hasSMAction()

bool Dragengine.Scenery.GWBehaviorBTSM.hasSMAction ( String name)

State machine action is present.

References hasBTAction(), and pBTActions.

Referenced by runSMEvent().

◆ hasSMCondition()

bool Dragengine.Scenery.GWBehaviorBTSM.hasSMCondition ( String name)

State machine condition is present.

References new(), and setBTCondition().

Referenced by runSMEvent().

◆ init()

void Dragengine.Scenery.GWBehaviorBTSM.init ( StubGameWorld stub)

Initialize game world from stub.

Reimplemented from Dragengine.Scenery.DefaultGWBehavior.

References new().

Referenced by hasBTCondition().

◆ new()

◆ registerReceiveEvents()

void Dragengine.Scenery.GWBehaviorBTSM.registerReceiveEvents ( ECBehaviorStateMachine.Instance stateMachine)

Register state machine to receive events.

References new(), and pBTActions.

Referenced by runSMEvent().

◆ removeAllBTActions()

void Dragengine.Scenery.GWBehaviorBTSM.removeAllBTActions ( )

Remove all behavior tree actions.

References setBTCondition().

Referenced by runSMEvent().

◆ removeAllBTConditions()

void Dragengine.Scenery.GWBehaviorBTSM.removeAllBTConditions ( )

Remove all behavior tree conditions.

References setAction(), setActionCondition(), and setCondition().

Referenced by removeSMCondition().

◆ removeAllSMActions()

void Dragengine.Scenery.GWBehaviorBTSM.removeAllSMActions ( )

Remove all state machine actions.

References new().

Referenced by runSMEvent().

◆ removeAllSMConditions()

void Dragengine.Scenery.GWBehaviorBTSM.removeAllSMConditions ( )

Remove all state machine conditions.

Referenced by runSMEvent().

◆ removeBTAction()

void Dragengine.Scenery.GWBehaviorBTSM.removeBTAction ( String name)

Remove behavior tree action.

References forEachBTCondition().

Referenced by runSMEvent().

◆ removeBTCondition()

void Dragengine.Scenery.GWBehaviorBTSM.removeBTCondition ( String name)

Remove behavior tree condition.

Referenced by setSMCondition().

◆ removeSMAction()

void Dragengine.Scenery.GWBehaviorBTSM.removeSMAction ( String name)

Remove state machine action.

References setBTAction().

Referenced by runSMEvent().

◆ removeSMCondition()

void Dragengine.Scenery.GWBehaviorBTSM.removeSMCondition ( String name)

Remove state machine condition.

References removeAllBTConditions().

Referenced by runSMEvent().

◆ runSMEvent()

void Dragengine.Scenery.GWBehaviorBTSM.runSMEvent ( String event)

Run event on registered state machines.

To avoid conflicts with events send by element class behaviors prefix event with "gameWorld." unless it is a global event with unique name.

References forEachSMAction(), forEachSMCondition(), getSMAction(), getSMActionCount(), getSMCondition(), getSMConditionCount(), hasSMAction(), hasSMCondition(), new(), pBTActions, pReceiveEventsSMs, registerReceiveEvents(), removeAllBTActions(), removeAllSMActions(), removeAllSMConditions(), removeBTAction(), removeSMAction(), removeSMCondition(), runSMEvent(), setSMAction(), setSMCondition(), and unregisterReceiveEvents().

Referenced by runSMEvent().

◆ setAction()

void Dragengine.Scenery.GWBehaviorBTSM.setAction ( String name,
BTSMActionCondition action )

Set state machine and behavior tree action.

References new(), and pBTActions.

Referenced by forEachBTCondition(), hasBTCondition(), and removeAllBTConditions().

◆ setActionCondition()

void Dragengine.Scenery.GWBehaviorBTSM.setActionCondition ( String name,
BTSMActionCondition actionCondition )

Set state machine and behavior tree action and condition.

References dispose(), and pBTActions.

Referenced by removeAllBTConditions().

◆ setBTAction() [1/2]

void Dragengine.Scenery.GWBehaviorBTSM.setBTAction ( String name,
Block action )

Set behavior tree action for name using block.

◆ setBTAction() [2/2]

void Dragengine.Scenery.GWBehaviorBTSM.setBTAction ( String name,
BTAction action )

Set behavior tree action for name.

Referenced by forEachBTCondition(), removeSMAction(), and unregisterReceiveEvents().

◆ setBTCondition() [1/2]

void Dragengine.Scenery.GWBehaviorBTSM.setBTCondition ( String name,
Block condition )

Set behavior tree condition for name using block.

References setBTCondition(), setCondition(), and setSMCondition().

◆ setBTCondition() [2/2]

void Dragengine.Scenery.GWBehaviorBTSM.setBTCondition ( String name,
BTCondition condition )

Set behavior tree condition for name.

Referenced by hasSMCondition(), removeAllBTActions(), and setBTCondition().

◆ setCondition()

void Dragengine.Scenery.GWBehaviorBTSM.setCondition ( String name,
BTSMActionCondition condition )

Set state machine and behavior tree condition.

References new(), and pReceiveEventsSMs.

Referenced by removeAllBTConditions(), and setBTCondition().

◆ setSMAction() [1/2]

void Dragengine.Scenery.GWBehaviorBTSM.setSMAction ( String name,
Block action )

Set state machine action for name using block.

References forEachBTAction(), and pBTActions.

◆ setSMAction() [2/2]

void Dragengine.Scenery.GWBehaviorBTSM.setSMAction ( String name,
SMAction action )

Set state machine action for name.

Referenced by forEachBTCondition(), and runSMEvent().

◆ setSMCondition() [1/2]

void Dragengine.Scenery.GWBehaviorBTSM.setSMCondition ( String name,
Block condition )

Set state machine condition for name using block.

◆ setSMCondition() [2/2]

void Dragengine.Scenery.GWBehaviorBTSM.setSMCondition ( String name,
SMCondition condition )

Set state machine condition for name.

References removeBTCondition().

Referenced by runSMEvent(), and setBTCondition().

◆ unregisterReceiveEvents()

void Dragengine.Scenery.GWBehaviorBTSM.unregisterReceiveEvents ( ECBehaviorStateMachine.Instance stateMachine)

Unregister state machine from receiving events.

References new(), pBTActions, and setBTAction().

Referenced by runSMEvent().

Member Data Documentation

◆ pBTActions

◆ pReceiveEventsSMs

SafeArray Dragengine.Scenery.GWBehaviorBTSM.pReceiveEventsSMs

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