2015-08-09 22:15:36 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace trainscript
|
|
|
|
{
|
|
|
|
enum class TypeID
|
|
|
|
{
|
2015-08-10 10:10:05 +00:00
|
|
|
Invalid = 0,
|
2015-08-09 22:15:36 +00:00
|
|
|
Void = 1,
|
|
|
|
Int = 2,
|
|
|
|
Real = 3,
|
|
|
|
Text = 4,
|
2015-08-10 14:37:16 +00:00
|
|
|
Bool = 5,
|
2015-08-09 22:15:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static const char *typeName(TypeID id) {
|
|
|
|
switch(id) {
|
2015-08-10 10:10:05 +00:00
|
|
|
case TypeID::Invalid: return "INVALID";
|
2015-08-09 22:15:36 +00:00
|
|
|
case TypeID::Void: return "VOID";
|
|
|
|
case TypeID::Int: return "INT";
|
|
|
|
case TypeID::Real: return "REAL";
|
|
|
|
case TypeID::Text: return "TEXT";
|
2015-08-10 14:37:16 +00:00
|
|
|
case TypeID::Bool: return "BOOL";
|
2015-08-09 22:15:36 +00:00
|
|
|
default: return "unknown";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|