1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Add templated version of ObjectDB::get_instance()

This commit is contained in:
kobewi
2025-03-27 14:42:42 +01:00
parent 594d64ec24
commit bc9d0c7835
49 changed files with 121 additions and 104 deletions

View File

@@ -46,6 +46,9 @@
template <typename T>
class TypedArray;
template <typename T>
class Ref;
enum PropertyHint {
PROPERTY_HINT_NONE, ///< no hint provided.
PROPERTY_HINT_RANGE, ///< hint_text = "min,max[,step][,or_greater][,or_less][,hide_slider][,radians_as_degrees][,degrees][,exp][,suffix:<keyword>] range.
@@ -1052,6 +1055,15 @@ public:
return object;
}
template <typename T>
_ALWAYS_INLINE_ static T *get_instance(ObjectID p_instance_id) {
return Object::cast_to<T>(get_instance(p_instance_id));
}
template <typename T>
_ALWAYS_INLINE_ static Ref<T> get_ref(ObjectID p_instance_id); // Defined in ref_counted.h
static void debug_objects(DebugFunc p_func);
static int get_object_count();
};