You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-20 14:45:44 +00:00
Add functions to retrieve type of a typed Array
This commit is contained in:
@@ -547,6 +547,22 @@ void Array::set_typed(uint32_t p_type, const StringName &p_class_name, const Var
|
|||||||
_p->typed.where = "TypedArray";
|
_p->typed.where = "TypedArray";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Array::is_typed() const {
|
||||||
|
return _p->typed.type != Variant::NIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t Array::get_typed_builtin() const {
|
||||||
|
return _p->typed.type;
|
||||||
|
}
|
||||||
|
|
||||||
|
StringName Array::get_typed_class_name() const {
|
||||||
|
return _p->typed.class_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
Variant Array::get_typed_script() const {
|
||||||
|
return _p->typed.script;
|
||||||
|
}
|
||||||
|
|
||||||
Array::Array(const Array &p_from) {
|
Array::Array(const Array &p_from) {
|
||||||
_p = nullptr;
|
_p = nullptr;
|
||||||
_ref(p_from);
|
_ref(p_from);
|
||||||
|
|||||||
@@ -113,6 +113,10 @@ public:
|
|||||||
|
|
||||||
bool typed_assign(const Array &p_other);
|
bool typed_assign(const Array &p_other);
|
||||||
void set_typed(uint32_t p_type, const StringName &p_class_name, const Variant &p_script);
|
void set_typed(uint32_t p_type, const StringName &p_class_name, const Variant &p_script);
|
||||||
|
bool is_typed() const;
|
||||||
|
uint32_t get_typed_builtin() const;
|
||||||
|
StringName get_typed_class_name() const;
|
||||||
|
Variant get_typed_script() const;
|
||||||
Array(const Array &p_from);
|
Array(const Array &p_from);
|
||||||
Array();
|
Array();
|
||||||
~Array();
|
~Array();
|
||||||
|
|||||||
Reference in New Issue
Block a user