RAIN.BehaviorTrees.BTConditionNode Class Reference

BTConditionNode is a behavior tree leaf node that evaluates a conditional expression to either true or false. A true evaluation will return an ActionResult of SUCCESS. A false evaluation will return an ActionResult of FAILURE. More complex computational evaluations must be coded as BTActionNodes. More...

Inheritance diagram for RAIN.BehaviorTrees.BTConditionNode:
RAIN.BehaviorTrees.BTNode RAIN.Action.Action

List of all members.

Public Member Functions

 BTConditionNode (string nodeName)
 Constructor.
void SetExpression (string expression)
 Set the conditional expression using parseable text.
override ActionResult Start (Agent agent, float deltaTime)
 Start Action handler.
override ActionResult Execute (Agent agent, float deltaTime)
 Execute causes the ConditionalExpression to be evaluated. The variable context is reset before evaluation based on the VariableContext stored in the actionContext.
override Action.Action.ActionResult Stop (Agent agent, float deltaTime)
 Stop Action handler.

Public Attributes

const string NODETYPE = "condition"
 Node type, used in xml parsing.

Properties

ConditionalExpression Conditional [get, set]

Detailed Description

BTConditionNode is a behavior tree leaf node that evaluates a conditional expression to either true or false. A true evaluation will return an ActionResult of SUCCESS. A false evaluation will return an ActionResult of FAILURE. More complex computational evaluations must be coded as BTActionNodes.


Constructor & Destructor Documentation

RAIN.BehaviorTrees.BTConditionNode.BTConditionNode ( string  nodeName)

Constructor.

Parameters:
nodeNameThe name of the node to create

Member Function Documentation

override ActionResult RAIN.BehaviorTrees.BTConditionNode.Execute ( Agent  agent,
float  deltaTime 
) [virtual]

Execute causes the ConditionalExpression to be evaluated. The variable context is reset before evaluation based on the VariableContext stored in the actionContext.

Parameters:
agentAI Agent owner of the behavior tree
deltaTimetimestep in seconds
Returns:
ActionResult, SUCCESS if the expression evaluates to true, FAILURE otherwise

Reimplemented from RAIN.Action.Action.

void RAIN.BehaviorTrees.BTConditionNode.SetExpression ( string  expression)

Set the conditional expression using parseable text.

Parameters:
expressionThe text expression to parse. See Belief.ConditionalExpressionParser.
override ActionResult RAIN.BehaviorTrees.BTConditionNode.Start ( Agent  agent,
float  deltaTime 
) [virtual]

Start Action handler.

Parameters:
agentAI Agent owner of the behavior tree
deltaTimetimestep in seconds
Returns:
ActionResult

Reimplemented from RAIN.Action.Action.

override Action.Action.ActionResult RAIN.BehaviorTrees.BTConditionNode.Stop ( Agent  agent,
float  deltaTime 
) [virtual]

Stop Action handler.

Parameters:
agentAI Agent owner of the behavior tree
deltaTimetimestep in seconds
Returns:
ActionResult

Reimplemented from RAIN.Action.Action.


Member Data Documentation

const string RAIN.BehaviorTrees.BTConditionNode.NODETYPE = "condition"

Node type, used in xml parsing.