|
Drag[en]gine Script Module DragonScript 1.35
|
Behavior tree choice rule. More...
Public Member Functions | |
| bool | getDoNotFail () |
| Return success if all child actions fail. | |
| bool | getLooping () |
| Looping. | |
| BTRuleChoice | new (String id) |
| Create behavior tree rule. | |
| BTResult | run (BTContext context) |
| Run action. | |
| void | setDoNotFail (bool doNotFail) |
| Set to return success if all child actions fail. | |
| void | setLooping (bool looping) |
| Set looping. | |
| String | toString () |
| Public Member Functions inherited from Dragengine.BehaviorTreeSystem.BTRuleList | |
| void | addRule (BTRule rule) |
| Add rule. | |
| BTRule | find (Block ablock) |
| Find rule with block with parameter BTRule. | |
| void | forEach (Block ablock) |
| Visit rules with block with parameter BTRule. | |
| BTRule | getRuleAt (int index) |
| Get rule at index. | |
| int | getRuleCount () |
| Number of rules. | |
| int | indexOfRule (BTRule rule) |
| Index of rule or -1 if absent. | |
| void | removeAllRules () |
| Remove all rules. | |
| void | removeRule (BTRule rule) |
| Remove rule. | |
| Public Member Functions inherited from Dragengine.BehaviorTreeSystem.BTRule | |
| String | getID () |
| Unique rule identifier or null. | |
| BTRule | getParent () |
| Parent rule or null if this is the root rule in a behavior tree. | |
| void | setParent (BTRule rule) |
| Set parent rule or null if this is the root rule in a behavior tree. | |
| Public Member Functions inherited from Dragengine.BehaviorTreeSystem.BTConditionGroup | |
| void | addCondition (String condition) |
| Add condition. | |
| void | addConditionGroup (BTConditionGroup group) |
| Add condition group. | |
| bool | evaluateConditions (BTContext context) |
| Evaluate all conditions. | |
| String | findCondition (Block ablock) |
| Find condition with block with parameter String. | |
| BTConditionGroup | findConditionGroup (Block ablock) |
| Find condition group with block with parameter BTConditionGroup. | |
| void | forEachCondition (Block ablock) |
| Visit conditions with block with parameter String. | |
| void | forEachConditionGroup (Block ablock) |
| Visit condition groups with block with parameter BTConditionGroup. | |
| String | getConditionAt (int index) |
| Get condition at index. | |
| int | getConditionCount () |
| Number of conditions. | |
| BTConditionGroup | getConditionGroupAt (int index) |
| Get condition group at index. | |
| int | getConditionGroupCount () |
| Count of condition groups. | |
| Array | getConditionGroups () |
| Get all condition groups as Array of BTConditionGroup. | |
| BTRule.ConditionMode | getConditionMode () |
| Condition mode from eConditionModes. | |
| Dictionary | getParameters () |
| Parameters as Dictionary of String key and String value. | |
| int | indexOfCondition (String condition) |
| Index of condition or -1 if absent. | |
| BTConditionGroup | new () |
| Create behavior tree condition group. | |
| void | removeAllConditions () |
| Remove all conditions. | |
| void | removeCondition (String condition) |
| Remove condition. | |
| void | setConditionMode (BTRule.ConditionMode mode) |
| Set condition mode from eConditionModes. | |
Public Attributes | |
| bool | pDoNotFail |
| bool | pLooping |
| Public Attributes inherited from Dragengine.BehaviorTreeSystem.BTRuleList | |
| Array | pRules |
| Public Attributes inherited from Dragengine.BehaviorTreeSystem.BTRule | |
| String | pID |
| WeakReference | pParent |
| Public Attributes inherited from Dragengine.BehaviorTreeSystem.BTConditionGroup | |
| BTRule.ConditionMode | pConditionMode |
| Array | pConditions |
| Dictionary | pParameters |
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 .
| bool Dragengine.BehaviorTreeSystem.BTRuleChoice.getDoNotFail | ( | ) |
Return success if all child actions fail.
References getDoNotFail().
Referenced by getDoNotFail().
| bool Dragengine.BehaviorTreeSystem.BTRuleChoice.getLooping | ( | ) |
| BTRuleChoice Dragengine.BehaviorTreeSystem.BTRuleChoice.new | ( | String | id | ) |
Create behavior tree rule.
Reimplemented from Dragengine.BehaviorTreeSystem.BTRuleList.
References new().
Referenced by new().
| BTResult Dragengine.BehaviorTreeSystem.BTRuleChoice.run | ( | BTContext | context | ) |
Run action.
Reimplemented from Dragengine.BehaviorTreeSystem.BTRule.
Referenced by toString().
| void Dragengine.BehaviorTreeSystem.BTRuleChoice.setDoNotFail | ( | bool | doNotFail | ) |
Set to return success if all child actions fail.
References pDoNotFail, and setDoNotFail().
Referenced by setDoNotFail().
| void Dragengine.BehaviorTreeSystem.BTRuleChoice.setLooping | ( | bool | looping | ) |
| String Dragengine.BehaviorTreeSystem.BTRuleChoice.toString | ( | ) |
String representation of object.
References Dragengine.BehaviorTreeSystem.BTConditionGroup.evaluateConditions(), Dragengine.BehaviorTreeSystem.BTRuleList.getRuleCount(), Dragengine.BehaviorTreeSystem.BTRuleList.indexOfRule(), pDoNotFail, and run().
| bool Dragengine.BehaviorTreeSystem.BTRuleChoice.pDoNotFail |
Referenced by setDoNotFail(), and toString().
| bool Dragengine.BehaviorTreeSystem.BTRuleChoice.pLooping |
Referenced by getLooping(), and setLooping().