Qualia  0.2
Public Member Functions | Public Attributes | List of all members
BehaviorTree::SequentialNode Class Reference

Executes behaviors in order. More...

#include <SequentialNode.h>

Inheritance diagram for BehaviorTree::SequentialNode:
Inheritance graph
[legend]
Collaboration diagram for BehaviorTree::SequentialNode:
Collaboration graph
[legend]

Public Member Functions

 SequentialNode ()
 Construct a sequentialNode. More...
 
BEHAVIOR_STATUS execute (void *agent)
 This method is invoked by the node's parent when the node should be run. More...
 
void init (void *agent)
 This method will be invoked before the node is executed for the first time. More...
 
- Public Member Functions inherited from BehaviorTree::BehaviorTreeInternalNode
 BehaviorTreeInternalNode ()
 
virtual ~BehaviorTreeInternalNode ()
 
virtual BehaviorTreeNodesetChildren (BehaviorTreeNode *node,...)
 
virtual BehaviorTreeNode_setChildren (BehaviorTreeNode *node, va_list nodeList)
 Helper method for setChildren(). More...
 
- Public Member Functions inherited from BehaviorTree::BehaviorTreeNode
virtual ~BehaviorTreeNode ()
 

Public Attributes

int currentPosition
 Where the SequentialNode currently is executing. -1 indicates the SequentialNode is not executing any child. More...
 
- Public Attributes inherited from BehaviorTree::BehaviorTreeInternalNode
BehaviorTreeNode ** children
 This node's children nodes. More...
 
uint8_t nChildren
 The number of children of this node. More...
 

Detailed Description

Executes behaviors in order.

Executes its children in the order they were added.

If the currently executing child returns BT_FAILURE, BT_ERROR, or BT_RUNNING, this returns the same status. If the currently executing child returns BT_SUCCESS, this begins executing the next child, if it exists. It continues in this fashion until one of the children returns BT_FAILURE, BT_ERROR, or BT_RUNNING. If all children have successfully executed, it will return BT_SUCCESS.

Constructor & Destructor Documentation

SequentialNode::SequentialNode ( )

Construct a sequentialNode.

Member Function Documentation

BEHAVIOR_STATUS SequentialNode::execute ( void *  agent)
virtual

This method is invoked by the node's parent when the node should be run.

Implements BehaviorTree::BehaviorTreeInternalNode.

void SequentialNode::init ( void *  agent)
virtual

This method will be invoked before the node is executed for the first time.

Implements BehaviorTree::BehaviorTreeInternalNode.

Member Data Documentation

int BehaviorTree::SequentialNode::currentPosition

Where the SequentialNode currently is executing. -1 indicates the SequentialNode is not executing any child.


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