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:
|
2023-08-28 17:24:55 +00:00
|
|
|
StringName method;
|
2023-08-15 11:09:18 +00:00
|
|
|
Ref<BBNode> node_param;
|
|
|
|
Array args;
|
2023-12-27 18:43:54 +00:00
|
|
|
bool include_delta = false;
|
2023-08-15 11:09:18 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
|
|
|
|
2024-01-06 23:47:46 +00:00
|
|
|
virtual String _generate_name() override;
|
2023-09-19 11:43:26 +00:00
|
|
|
virtual Status _tick(double p_delta) override;
|
2023-08-15 11:09:18 +00:00
|
|
|
|
|
|
|
public:
|
2023-08-28 17:24:55 +00:00
|
|
|
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; }
|
|
|
|
|
2023-12-27 18:43:54 +00:00
|
|
|
void set_include_delta(bool p_include_delta);
|
|
|
|
bool is_delta_included() const { return include_delta; }
|
|
|
|
|
2024-01-06 23:47:46 +00:00
|
|
|
virtual PackedStringArray get_configuration_warnings() override;
|
2023-12-28 13:26:39 +00:00
|
|
|
|
|
|
|
BTCallMethod();
|
2023-08-15 11:09:18 +00:00
|
|
|
};
|
|
|
|
|
2023-12-27 18:43:54 +00:00
|
|
|
#endif // BT_CALL_METHOD
|