diff options
Diffstat (limited to 'core/variant.cpp')
-rw-r--r-- | core/variant.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/variant.cpp b/core/variant.cpp index f4e4cd5341..0f04710d13 100644 --- a/core/variant.cpp +++ b/core/variant.cpp @@ -1248,6 +1248,14 @@ Variant::operator uint64_t() const { } } +Variant::operator ObjectID() const { + if (type == INT) { + return ObjectID(_data._int); + } else { + return ObjectID(); + } +} + #ifdef NEED_LONG_INT Variant::operator signed long() const { @@ -2193,6 +2201,11 @@ Variant::Variant(double p_double) { _data._real = p_double; } +Variant::Variant(const ObjectID &p_id) { + type = INT; + _data._int = p_id; +} + Variant::Variant(const StringName &p_string) { type = STRING; |