Compatible with bool, int, float, double, string, Vector2, Vector3 and Vector4.
Remarks: Has implicit assignment for all compatible types, but can only be retrieved using explicit casting methods.
Variant var; var = 1.0f; float f = var.AsFloat(); var = Vector2(1,2); Vector2 v = var.AsVector2(); $Points = 100; Print("Points = " + $Points.AsString());
Warning: Variants will morph depending on which type is assigned to it. This can cause data loss in some cases.
Variant var = "Hello."; // var is "Hello." var = Vector3(1,2,3); // var is (1,2,3) var *= 2.0f; // var is (2,4,6) var += Vector2(1,2); // var is (3,6) var -= 2; // var is (1) var += "3,1"; // var is (13,1)
Variant()
Constructor.
Variant(const Variant& Other)
Constructor.
Variant(bool Value)
Constructor.
Variant(int Value)
Constructor.
Variant(float Value)
Constructor.
Variant(double Value)
Constructor.
Variant(const string& Value)
Constructor.
Variant(const Vector2& Value)
Constructor.
Variant(const Vector3& Value)
Constructor.
Variant(const Vector4& Value)
Constructor.
int AsString()
Return value as string.
int AsBool()
Return value as bool.
This returns true unless variant is zero, "" or "false".
int AsInt()
Return value as integer.
int AsFloat()
Return value as float.
int AsDouble()
Return value as double.
int AsVector2()
Return value as Vector2.
int AsVector3()
Return value as Vector3.
int AsVector4()
Return value as Vector4.