19 TreeNodeStatus
execute(const AIPtr& entity, int64_t deltaMillis)
override {
20 if (_children.size() != 1) {
21 ai_assert(
false,
"Fail must have exactly one child");
28 const TreeNodePtr& treeNode = *_children.begin();
29 const TreeNodeStatus status = treeNode->execute(entity, deltaMillis);
30 if (status == RUNNING) {
31 return state(entity, RUNNING);
33 return state(entity, FAILED);
#define ai_assert(condition,...)
Provide your own assert - this is only executed in DEBUG mode.
Definition: Types.h:75
virtual TreeNodeStatus execute(const AIPtr &entity, int64_t deltaMillis)
Definition: TreeNodeImpl.h:184
A decorator node with only one child attached. The result of the attached child is only taken into ac...
Definition: Fail.h:15
The base class for all behaviour tree actions.
Definition: TreeNode.h:88
#define NODE_CLASS(NodeName)
A node class macro that also defines a factory.
Definition: TreeNode.h:69
TreeNodeStatus execute(const AIPtr &entity, int64_t deltaMillis) override
Definition: Fail.h:19