Qualia
0.2
|
Wraps a function or member pointer that returns an integer value into a conditional node. More...
#include <IntCondition.h>
Public Member Functions | |
BEHAVIOR_STATUS | execute (void *agent) |
Runs the test given in the constructor, and returns BT_SUCCESS if the test passes, or BT_FAILURE if the test fails. More... | |
void | init (void *agent) |
This method will be invoked before the node is executed for the first time. More... | |
IntCondition (int(T::*const _func)(), INT_TEST _test, int _val) | |
IntCondition (int(*const _func)(), INT_TEST _test, int _val) | |
IntCondition (int(T::*const _func)() const, INT_TEST _test, int _val) | |
template<> | |
BEHAVIOR_STATUS | execute (void *agent) |
This method is invoked by the node's parent when the node should be run. More... | |
![]() | |
virtual | ~BehaviorTreeNode () |
Private Attributes | |
int(T::*const | func )() |
int(*const | func2 )() |
INT_TEST | test |
int | val |
Wraps a function or member pointer that returns an integer value into a conditional node.
To wrap a function pointer or static class member that takes no arguments and returns an int, instantiate IntCondition without a type argument.
For example, to wrap the function "func", with the signature "int func()", one would do this: IntCondition<> condition(&func,EQUAL,5);
To wrap the static method "sMethod" of the class "Class", one would do this: IntCondition<> condition(&Class::sMethod,EQUAL,5);
To wrap a non-static class member, IntCondition must be parameterized with the class's type. For example, to wrap the method "method" of class "Class", one would do this: IntCondition<Class> condition(&Class:method,EQUAL,5);
|
inline |
_func | the address of the class member |
_test | the mathematical operation to perform on the return value of _func |
_val | the 'right side' of the mathematical expression the node performs |
|
inline |
_func | the address of the function or static class member |
_test | the mathematical operation to perform on the return value of _func |
_val | the 'right side' of the mathematical expression the node performs |
|
inline |
_func | the address of the const class member |
_test | the mathematical operation to perform on the return value of _func |
_val | the 'right side' of the mathematical expression the node performs |
|
inlinevirtual |
Runs the test given in the constructor, and returns BT_SUCCESS if the test passes, or BT_FAILURE if the test fails.
Implements BehaviorTree::BehaviorTreeNode.
|
virtual |
This method is invoked by the node's parent when the node should be run.
Implements BehaviorTree::BehaviorTreeNode.
|
inlinevirtual |
This method will be invoked before the node is executed for the first time.
Implements BehaviorTree::BehaviorTreeNode.
|
private |
|
private |
|
private |
|
private |