limboai/bt/tasks/utility/bt_call_method.h

54 lines
1.3 KiB
C
Raw Normal View History

2023-08-15 11:09:18 +00:00
/**
* bt_call_method.h
* =============================================================================
* Copyright 2021-2023 Serhii Snitsaruk
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
#ifndef BT_CALL_METHOD_H
#define BT_CALL_METHOD_H
2023-08-15 15:49:13 +00:00
#include "../bt_action.h"
2023-08-15 11:09:18 +00:00
2024-01-10 22:26:24 +00:00
#include "../../../blackboard/bb_param/bb_node.h"
2023-08-15 11:09:18 +00:00
class BTCallMethod : public BTAction {
GDCLASS(BTCallMethod, BTAction);
2023-09-20 08:40:16 +00:00
TASK_CATEGORY(Utility);
2023-08-15 11:09:18 +00:00
private:
StringName method;
2023-08-15 11:09:18 +00:00
Ref<BBNode> node_param;
Array args;
bool include_delta = false;
2023-08-15 11:09:18 +00:00
protected:
static void _bind_methods();
virtual String _generate_name() override;
virtual Status _tick(double p_delta) override;
2023-08-15 11:09:18 +00:00
public:
void set_method(StringName p_method_name);
StringName get_method() const { return method; }
2023-08-15 11:09:18 +00:00
void set_node_param(Ref<BBNode> p_object);
Ref<BBNode> get_node_param() const { return node_param; }
void set_args(Array p_args);
Array get_args() const { return args; }
void set_include_delta(bool p_include_delta);
bool is_delta_included() const { return include_delta; }
virtual PackedStringArray get_configuration_warnings() override;
BTCallMethod();
2023-08-15 11:09:18 +00:00
};
2024-01-13 16:10:42 +00:00
#endif // BT_CALL_METHOD_H