|
Drag[en]gine Script Module DragonScript 1.35
|
BTSMActionCondition tailored for condition use (action behaves as condition). More...
Public Member Functions | |
| bool | evaluateConditionShared (Object context, Dictionary parameters) |
| Evaluate condition. | |
| bool | evaluateConditionShared (String prefix, Object context, Dictionary parameters) |
| Evaluate condition. | |
| String | getPrefix () |
| Prefix for condition parameter names. | |
| String | getWaitParameterName () |
| Parameter name for wait. | |
| BTSMCondition | new (String prefix) |
| Create shared behavior tree and state machine action and condition. | |
| BTSMCondition | new (String prefix, String waitParameter) |
| Create shared behavior tree and state machine action and condition. | |
| BTResult | runActionShared (Object context, Dictionary parameters) |
| Run action shared. | |
| Public Member Functions inherited from Dragengine.Utils.BTSMActionCondition | |
| bool | evaluateCondition (BTContext context, Dictionary parameters) |
| Evaluate condition. | |
| bool | evaluateCondition (SMContext context, Dictionary parameters) |
| Evaluate condition. | |
| BTSMActionCondition | new () |
| Create shared behavior tree and state machine action and condition. | |
| BTResult | runAction (BTContext context, Dictionary parameters) |
| Run action. | |
| void | runAction (SMContext context, Dictionary parameters) |
| Run action. | |
Public Attributes | |
| String | pPrefix |
BTSMActionCondition tailored for condition use (action behaves as condition).
This class is useful to use the same set of actions and conditions for both behavior trees and state machines. State machine actions throw an exception if the shared action returns BTResult#failure.
Overwrite BTSMCondition.evaluateConditionShared(String,Object,Dictionary).
Typical usage looks like this (inside an Scenery.DefaultECBehaviorInstance subclass):
And adding it to ECComposeBTSM.Instance like this (in Scenery.DefaultECBehaviorInstance.init()):
| bool Dragengine.Utils.BTSMCondition.evaluateConditionShared | ( | Object | context, |
| Dictionary | parameters ) |
Evaluate condition.
Context which can be either BTContext or SMContext.
Default implementation returns false.
Reimplemented from Dragengine.Utils.BTSMActionCondition.
References evaluateConditionShared(), and runActionShared().
| bool Dragengine.Utils.BTSMCondition.evaluateConditionShared | ( | String | prefix, |
| Object | context, | ||
| Dictionary | parameters ) |
Evaluate condition.
Context which can be either BTContext or SMContext. Prefix has to be prepended to parameter names. For action use prefix is empty string. For condition use prefix is getPrefix().
Default implementation returns false.
Referenced by evaluateConditionShared().
| String Dragengine.Utils.BTSMCondition.getPrefix | ( | ) |
Prefix for condition parameter names.
References pPrefix.
Referenced by runActionShared().
| String Dragengine.Utils.BTSMCondition.getWaitParameterName | ( | ) |
| BTSMCondition Dragengine.Utils.BTSMCondition.new | ( | String | prefix | ) |
Create shared behavior tree and state machine action and condition.
Prefix is typically the behavior element behavior prefix. For example for Scenery.ECBehaviorSpeaker the prefix would be "speaker.".
References new().
| BTSMCondition Dragengine.Utils.BTSMCondition.new | ( | String | prefix, |
| String | waitParameter ) |
Create shared behavior tree and state machine action and condition.
References new().
| BTResult Dragengine.Utils.BTSMCondition.runActionShared | ( | Object | context, |
| Dictionary | parameters ) |
Run action shared.
For state machine use exception is thrown if the returned value is BTResult#failure. Default implementation returns BTResult#failure.
Context which can be either BTContext or SMContext.
Reimplemented from Dragengine.Utils.BTSMActionCondition.
References getPrefix(), getWaitParameterName(), and pPrefix.
Referenced by evaluateConditionShared().
| String Dragengine.Utils.BTSMCondition.pPrefix |
Referenced by getPrefix(), and runActionShared().