dungeon/src/RestNode.cpp

16 lines
370 B
C++
Raw Normal View History

2017-09-17 13:43:13 +02:00
#include "RestNode.h"
#include "BehaviourTree.h"
#include "Actor.h"
RestNode::RestNode(BehaviourTreeNode * parent) : BehaviourTreeNode(parent) {}
2017-09-26 15:49:11 +02:00
RestNode::~RestNode() = default;
2017-09-17 13:43:13 +02:00
BehaviourTreeStatus RestNode::tick(BTTick * tick) {
2017-09-26 15:49:11 +02:00
if (tick->target->get_health() < tick->target->get_health_max()) {
2017-09-17 13:43:13 +02:00
return BT_SUCCEEDED;
}
return BT_FAILED;
}