-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScriptTypeData.cpp
More file actions
47 lines (41 loc) · 856 Bytes
/
ScriptTypeData.cpp
File metadata and controls
47 lines (41 loc) · 856 Bytes
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
#include "ScriptTypeData.h"
#include "ScriptClassData.h"
ScriptTypeData::ScriptTypeData()
{
type = ST_VOID;
indirection = 0;
class_data = nullptr;
}
ScriptTypeData::~ScriptTypeData()
{
}
size_t ScriptTypeData::GetSize() const
{
if (indirection != 0)
return 8;
if (type == ST_CLASS && class_data)
return class_data->size;
if (type == ST_VOID)
return 0;
return 8;
}
bool ScriptTypeData::operator==(const ScriptTypeData& rhs) const
{
if (type != rhs.type)
return false;
if (indirection != rhs.indirection)
return false;
if (type == ST_CLASS)
return class_data == rhs.class_data;
return true;
}
bool ScriptTypeData::operator!=(const ScriptTypeData & rhs) const
{
if (type != rhs.type)
return true;
if (indirection != rhs.indirection)
return true;
if (type == ST_CLASS)
return class_data != rhs.class_data;
return false;
}