/
idecltypes.h
53 lines (46 loc) · 1.05 KB
/
idecltypes.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#pragma once
#include <stdexcept>
#include <string>
// Some X11 headers are defining this
#ifdef None
#undef None
#endif
namespace decl
{
// Enumeration of declaration types supported by DarkRadiant
enum class Type
{
Undetermined = -2,
None = -1,
Material = 0,
Table,
EntityDef,
SoundShader,
Model,
ModelDef,
Particle,
Skin,
// These are used in unit tests only
TestDecl,
TestDecl2,
};
inline std::string getTypeName(Type type)
{
switch (type)
{
case Type::Undetermined: return "Undetermined";
case Type::None: return "None";
case Type::Material: return "Material";
case Type::EntityDef: return "EntityDef";
case Type::SoundShader: return "SoundShader";
case Type::Model: return "Model";
case Type::ModelDef: return "ModelDef";
case Type::Particle: return "Particle";
case Type::Skin: return "Skin";
case Type::TestDecl: return "TestDecl";
case Type::TestDecl2: return "TestDecl2";
default:
throw std::runtime_error("Unhandled decl type");
}
}
}