Drag[en]gine Script Module DragonScript  1.23
Dragengine.BehaviorTreeSystem.BTRuleChoice Class Reference

Behavior tree choice rule. More...

Inheritance diagram for Dragengine.BehaviorTreeSystem.BTRuleChoice:
Dragengine.BehaviorTreeSystem.BTRuleList Dragengine.BehaviorTreeSystem.BTRule

Public Member Functions

bool getDoNotFail ()
 Return success if all child actions fail. More...
 
bool getLooping ()
 Looping. More...
 
BTRuleChoice new (String id)
 Create behavior tree rule. More...
 
BTResult run (BTContext context)
 Run action. More...
 
void setDoNotFail (bool doNotFail)
 Set to return success if all child actions fail. More...
 
void setLooping (bool looping)
 Set looping. More...
 
String toString ()
 
- Public Member Functions inherited from Dragengine.BehaviorTreeSystem.BTRuleList
void addRule (BTRule rule)
 Add rule. More...
 
BTRule find (Block ablock)
 Find rule with block with parameter BTRule. More...
 
void forEach (Block ablock)
 Visit rules with block with parameter BTRule. More...
 
BTRule getRuleAt (int index)
 Get rule at index. More...
 
int getRuleCount ()
 Number of rules. More...
 
int indexOfRule (BTRule rule)
 Index of rule or -1 if absent. More...
 
void removeAllRules ()
 Remove all rules. More...
 
void removeRule (BTRule rule)
 Remove rule. More...
 
- Public Member Functions inherited from Dragengine.BehaviorTreeSystem.BTRule
void addCondition (String condition)
 Add condition. More...
 
bool evaluateConditions (BTContext context)
 Evaluate all conditions. More...
 
String findCondition (Block ablock)
 Find condition with block with parameter String. More...
 
void forEachCondition (Block ablock)
 Visit conditions with block with parameter String. More...
 
String getConditionAt (int index)
 Get condition at index. More...
 
int getConditionCount ()
 Number of conditions. More...
 
ConditionMode getConditionMode ()
 Condition mode from eConditionModes. More...
 
String getID ()
 Unique rule identifier or null. More...
 
Dictionary getParameters ()
 Parameters as Dictionary of type String key and String value. More...
 
BTRule getParent ()
 Parent rule or null if this is the root rule in a behavior tree. More...
 
int indexOfCondition (String condition)
 Index of condition or -1 if absent. More...
 
void removeAllConditions ()
 Remove all conditions. More...
 
void removeCondition (String condition)
 Remove condition. More...
 
void setConditionMode (ConditionMode mode)
 Set condition mode from eConditionModes. More...
 
void setParent (BTRule rule)
 Set parent rule or null if this is the root rule in a behavior tree. More...
 

Public Attributes

bool pDoNotFail
 
bool pLooping
 
- Public Attributes inherited from Dragengine.BehaviorTreeSystem.BTRuleList
Array pRules
 
- Public Attributes inherited from Dragengine.BehaviorTreeSystem.BTRule
ConditionMode pConditionMode
 
Array pConditions
 
String pID
 
Dictionary pParameters
 
WeakReference pParent
 

Detailed Description

Behavior tree choice rule.

Runs all actions in sequence. Returns BTResult.failure if all actions returned BTResult.failure . If an action returns BTResult.success processing of the rule stops and BTResult.success is returned. If no actions are present BTResult.failure is returned.

If looping is set to true the choice restarts at the beginning if the first action returns BTResult.success . This allows to keep looping a choice until the first time all actions return BTResult.failure .

Member Function Documentation

◆ getDoNotFail()

bool Dragengine.BehaviorTreeSystem.BTRuleChoice.getDoNotFail ( )

Return success if all child actions fail.

Version
1.19

◆ getLooping()

bool Dragengine.BehaviorTreeSystem.BTRuleChoice.getLooping ( )

Looping.

◆ new()

BTRuleChoice Dragengine.BehaviorTreeSystem.BTRuleChoice.new ( String  id)

Create behavior tree rule.

Reimplemented from Dragengine.BehaviorTreeSystem.BTRuleList.

◆ run()

BTResult Dragengine.BehaviorTreeSystem.BTRuleChoice.run ( BTContext  context)

Run action.

Returns
Value from BTAction.eReturnValues .

◆ setDoNotFail()

void Dragengine.BehaviorTreeSystem.BTRuleChoice.setDoNotFail ( bool  doNotFail)

Set to return success if all child actions fail.

Version
1.19

◆ setLooping()

void Dragengine.BehaviorTreeSystem.BTRuleChoice.setLooping ( bool  looping)

Set looping.

◆ toString()

String Dragengine.BehaviorTreeSystem.BTRuleChoice.toString ( )

String representation of object.

Member Data Documentation

◆ pDoNotFail

bool Dragengine.BehaviorTreeSystem.BTRuleChoice.pDoNotFail

◆ pLooping

bool Dragengine.BehaviorTreeSystem.BTRuleChoice.pLooping

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