summaryrefslogtreecommitdiff
path: root/core/variant.h
diff options
context:
space:
mode:
authorAnton Yabchinskiy <arn@bestmx.ru>2014-12-23 23:44:07 +0300
committerAnton Yabchinskiy <arn@bestmx.ru>2014-12-23 23:44:07 +0300
commit4ab1bcde35a02cfe7b25d630720de1cc81ef5a1a (patch)
treeb476b0f4aa8df1801361a04390c98cf0e2e3d98b /core/variant.h
parentff755f93eb86e3f7f6801918457ca77a3001671b (diff)
parent530d717a67cc3acab10270dca700db328aa12891 (diff)
Merge branch 'master' of github.com:okamstudio/godot
Conflicts: drivers/SCsub platform/x11/detect.py platform/x11/os_x11.h
Diffstat (limited to 'core/variant.h')
-rw-r--r--core/variant.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/variant.h b/core/variant.h
index 9109f4ad08..47fc3f43ac 100644
--- a/core/variant.h
+++ b/core/variant.h
@@ -167,14 +167,18 @@ public:
static String get_type_name(Variant::Type p_type);
static bool can_convert(Type p_type_from,Type p_type_to);
+
+
template<class T>
static Type get_type_for() {
GetSimpleType<T> t;
Variant v(t.type);
- return v.get_type();
+ Type r = v.get_type();
+ return r;
}
+
bool is_ref() const;
_FORCE_INLINE_ bool is_num() const { return type==INT || type==REAL; };
_FORCE_INLINE_ bool is_array() const { return type>=ARRAY; };
@@ -415,6 +419,8 @@ public:
static bool has_numeric_constant(Variant::Type p_type, const StringName& p_value);
static int get_numeric_constant_value(Variant::Type p_type, const StringName& p_value);
+ String get_construct_string() const;
+
void operator=(const Variant& p_variant); // only this is enough for all the other types
Variant(const Variant& p_variant);
_FORCE_INLINE_ Variant() { type=NIL; }