1
0
Files
otyaSMILEBASIC/SMILEBASIC/type.d
otya128 6673ca3fc2 init
2015-06-03 19:51:42 +09:00

38 lines
627 B
D

module otya.smilebasic.type;
enum ValueType : byte
{
Integer,
Double,
String,
Array,
IntegerArray,
DoubleArray,
StringArray,
}
struct Value
{
ValueType type;
union
{
int integerValue;
double doubleValue;
wstring stringValue;
int[] intArray;
}
this(int value)
{
this.type = ValueType.Integer;
integerValue = value;
}
this(double value)
{
this.type = ValueType.Double;
doubleValue = value;
}
this(wstring value)
{
this.type = ValueType.String;
stringValue = value;
}
}