chore: cleaning up control_nodes
This commit is contained in:
parent
78db4ffa07
commit
1e7f1cb3f6
2 changed files with 8 additions and 8 deletions
|
|
@ -1,8 +1,6 @@
|
|||
#include "control_nodes.h"
|
||||
#include "behaviour_nodes/behaviour_node.h"
|
||||
|
||||
void BehaviourSequence::_bind_methods() {}
|
||||
|
||||
PackedStringArray BehaviourSequence::get_configuration_warnings() const {
|
||||
PackedStringArray warnings{ super_type::get_configuration_warnings() };
|
||||
if (get_child_behaviours().is_empty()) {
|
||||
|
|
@ -25,7 +23,9 @@ void BehaviourSequence::execute() {
|
|||
break;
|
||||
case Success:
|
||||
++this->current;
|
||||
set_status(this->current >= get_child_behaviours().size() ? Success : Running);
|
||||
set_status(this->current >= get_child_behaviours().size()
|
||||
? Success
|
||||
: Running);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
|
@ -40,8 +40,6 @@ BehaviourNode *BehaviourSequence::get_next() {
|
|||
: cast_to<BehaviourNode>(get_parent());
|
||||
}
|
||||
|
||||
void BehaviourSelector::_bind_methods() {}
|
||||
|
||||
PackedStringArray BehaviourSelector::get_configuration_warnings() const {
|
||||
PackedStringArray warnings{ super_type::get_configuration_warnings() };
|
||||
if (get_child_behaviours().is_empty()) {
|
||||
|
|
@ -61,7 +59,9 @@ void BehaviourSelector::execute() {
|
|||
break;
|
||||
case Fail:
|
||||
++this->current;
|
||||
set_status(this->current >= get_child_behaviours().size() ? Fail : Running);
|
||||
set_status(this->current >= get_child_behaviours().size()
|
||||
? Fail
|
||||
: Running);
|
||||
break;
|
||||
case Success:
|
||||
set_status(Success);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
class BehaviourSequence : public BehaviourComposite {
|
||||
GDCLASS(BehaviourSequence, BehaviourComposite);
|
||||
static void _bind_methods();
|
||||
static void _bind_methods() {}
|
||||
|
||||
public:
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
|
|
@ -18,7 +18,7 @@ private:
|
|||
|
||||
class BehaviourSelector : public BehaviourComposite {
|
||||
GDCLASS(BehaviourSelector, BehaviourNode);
|
||||
static void _bind_methods();
|
||||
static void _bind_methods() {}
|
||||
|
||||
public:
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue