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

A node that repeats its child a specified number of times. More...

#include <RepeatNode.h>

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

Public Member Functions

 RepeatNode (int repeats)
 
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::BehaviorTreeDecoratorNode
 BehaviorTreeDecoratorNode ()
 
virtual ~BehaviorTreeDecoratorNode ()
 
virtual BehaviorTreeNodesetChild (BehaviorTreeNode *node)
 Sets the child node of this node. More...
 
- Public Member Functions inherited from BehaviorTree::BehaviorTreeNode
virtual ~BehaviorTreeNode ()
 

Public Attributes

int count
 
int target
 
- Public Attributes inherited from BehaviorTree::BehaviorTreeDecoratorNode
BehaviorTreeNodechild
 This node's child node. More...
 

Detailed Description

A node that repeats its child a specified number of times.

If the child returns BT_FAILURE, RepeatNode will also return BT_FAILURE. However, if the child returns BT_SUCCESS and it hasn't completed the specified number of repetitions, RepeatNode will restart it and continue returning BT_RUNNING.

Constructor & Destructor Documentation

RepeatNode::RepeatNode ( int  repeats)
Parameters
repeatsThe number of times to repeat. An argument of -1 indicates the node should repeat indefinitely. Other negative numbers have undefined behavior

Member Function Documentation

BEHAVIOR_STATUS RepeatNode::execute ( void *  agent)
virtual

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

Implements BehaviorTree::BehaviorTreeDecoratorNode.

void BehaviorTree::RepeatNode::init ( void *  agent)
virtual

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

Implements BehaviorTree::BehaviorTreeDecoratorNode.

Member Data Documentation

int BehaviorTree::RepeatNode::count
int BehaviorTree::RepeatNode::target

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