dungeon/src/BehaviourTreeSelector.cpp

15 lines
410 B
C++
Raw Normal View History

2017-09-17 13:43:13 +02:00
#include "BehaviourTreeSelector.h"
BehaviourTreeSelector::BehaviourTreeSelector(BehaviourTreeNode* parent) : BehaviourTreeNode(parent) {}
BehaviourTreeStatus BehaviourTreeSelector::tick(BTTick* tick) {
for (int i = 0; i < children.size(); i++) {
BehaviourTreeStatus status = children[i]->execute(tick);
if (status != BT_FAILED) {
return status;
}
}
return BT_FAILED;
}