dungeon/src/BehaviourTreeSelector.cpp
2017-09-17 14:45:57 +02:00

14 lines
410 B
C++

#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;
}