diff options
author | Florian Jung <florian.jung@fau.de> | 2019-04-12 13:54:28 +0200 |
---|---|---|
committer | Florian Jung <florian.jung@fau.de> | 2019-04-12 13:55:56 +0200 |
commit | c5199a2fbf619249611cbf62d8e122eec9c1a825 (patch) | |
tree | 6ea015cce6ab6c8b281dc7538ff5fca73ed46865 /include/core/Variant.hpp | |
parent | f0fe88bd36603b5ccb0d1c865e1ad8432dbe3b5e (diff) | |
download | redot-cpp-c5199a2fbf619249611cbf62d8e122eec9c1a825.tar.gz |
Add a type conversion to Variant for anything that supports ___get_from_variant()
Diffstat (limited to 'include/core/Variant.hpp')
-rw-r--r-- | include/core/Variant.hpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/core/Variant.hpp b/include/core/Variant.hpp index 310bd41..5f40013 100644 --- a/include/core/Variant.hpp +++ b/include/core/Variant.hpp @@ -226,6 +226,7 @@ public: operator NodePath() const; operator RID() const; operator godot_object *() const; + template <typename T> operator T*() const { return static_cast<T*>(T::___get_from_variant(*this)); } operator Dictionary() const; operator Array() const; |