You've already forked godot
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:
@@ -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();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user