diff options
author | Juan Linietsky <reduzio@gmail.com> | 2021-08-25 18:50:15 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-25 18:50:15 -0300 |
commit | 5b01a3b3be2c352caea9b024fc11b0eec950ad8a (patch) | |
tree | 1b107e03304d4efb0c43028c3966bdcaee98cea9 /core/config/engine.h | |
parent | ae3a4224271fa058fd8424c6142a2357bd7624b2 (diff) | |
parent | e2f8df8c5b3b6a1d4c18a75ff1c8293cc5909bc0 (diff) |
Merge pull request #52084 from reduz/engine-singleton-register
Add ability to register singletons from Engine API
Diffstat (limited to 'core/config/engine.h')
-rw-r--r-- | core/config/engine.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/config/engine.h b/core/config/engine.h index e6b5df2d5a..ae33acede2 100644 --- a/core/config/engine.h +++ b/core/config/engine.h @@ -42,6 +42,7 @@ public: StringName name; Object *ptr; StringName class_name; //used for binding generation hinting + bool user_created = false; Singleton(const StringName &p_name = StringName(), Object *p_ptr = nullptr, const StringName &p_class_name = StringName()); }; @@ -109,8 +110,10 @@ public: void add_singleton(const Singleton &p_singleton); void get_singletons(List<Singleton> *p_singletons); - bool has_singleton(const String &p_name) const; - Object *get_singleton_object(const String &p_name) const; + bool has_singleton(const StringName &p_name) const; + Object *get_singleton_object(const StringName &p_name) const; + void remove_singleton(const StringName &p_name); + bool is_singleton_user_created(const StringName &p_name) const; #ifdef TOOLS_ENABLED _FORCE_INLINE_ void set_editor_hint(bool p_enabled) { editor_hint = p_enabled; } |