From a490ce25f68905eb8ae5e76de355ad82b5bf10be Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Wed, 10 Jan 2024 13:12:22 +0100 Subject: [PATCH] Add `is_class_static` virtual method to GDCLASS macro. --- include/godot_cpp/classes/wrapped.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/godot_cpp/classes/wrapped.hpp b/include/godot_cpp/classes/wrapped.hpp index f8f921b3..23fe9ff4 100644 --- a/include/godot_cpp/classes/wrapped.hpp +++ b/include/godot_cpp/classes/wrapped.hpp @@ -98,6 +98,10 @@ public: return string_name; } + virtual bool is_class_static(const StringName &p_string_name) const { + return p_string_name == get_class_static(); + } + uint64_t get_instance_id() const { return 0; } @@ -222,6 +226,10 @@ public: return string_name; \ } \ \ + virtual bool is_class_static(const StringName &p_string_name) const override { \ + return get_class_static() == p_string_name; \ + } \ + \ static ::godot::StringName &get_parent_class_static() { \ return m_inherits::get_class_static(); \ } \