-
Notifications
You must be signed in to change notification settings - Fork 29
/
UObjectFactory.cpp
266 lines (263 loc) · 5.54 KB
/
UObjectFactory.cpp
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
#include "UObjectFactory.h"
GlobalType UObjectFactory::NameToType(std::string name)
{
if (name == "None")
{
return GlobalType::None;
}
else if (name == "Object")
{
return GlobalType::UObject;
}
else if (name == "Field")
{
return GlobalType::UField;
}
else if (name == "Const")
{
return GlobalType::UConst;
}
else if (name == "Enum")
{
return GlobalType::UEnum;
}
else if (name == "Property")
{
return GlobalType::UProperty;
}
else if (name == "ByteProperty")
{
return GlobalType::UByteProperty;
}
else if (name == "IntProperty")
{
return GlobalType::UIntProperty;
}
else if (name == "BoolProperty")
{
return GlobalType::UBoolProperty;
}
else if (name == "FloatProperty")
{
return GlobalType::UFloatProperty;
}
else if (name == "ObjectProperty")
{
return GlobalType::UObjectProperty;
}
else if (name == "ClassProperty")
{
return GlobalType::UClassProperty;
}
else if (name == "ComponentProperty")
{
return GlobalType::UComponentProperty;
}
else if (name == "NameProperty")
{
return GlobalType::UNameProperty;
}
else if (name == "StructProperty")
{
return GlobalType::UStructProperty;
}
else if (name == "StrProperty")
{
return GlobalType::UStrProperty;
}
else if (name == "ArrayProperty")
{
return GlobalType::UArrayProperty;
}
else if (name == "FixedArrayProperty")
{
return GlobalType::UFixedArrayProperty;
}
else if (name == "DelegateProperty")
{
return GlobalType::UDelegateProperty;
}
else if (name == "InterfaceProperty")
{
return GlobalType::UInterfaceProperty;
}
else if (name == "MapProperty")
{
return GlobalType::UMapProperty;
}
else if (name == "Struct")
{
return GlobalType::UStruct;
}
else if (name == "ScriptStruct")
{
return GlobalType::UScriptStruct;
}
else if (name == "Function")
{
return GlobalType::UFunction;
}
else if (name == "State")
{
return GlobalType::UState;
}
else if (name == "Class")
{
return GlobalType::UClass;
}
else if (name == "TextBuffer")
{
return GlobalType::UTextBuffer;
}
else if (name == "Level")
{
return GlobalType::ULevel;
}
else if (name == "Surface")
{
return GlobalType::USurface;
}
else if (name == "Texture")
{
return GlobalType::UTexture;
}
else if (name == "Texture2D")
{
return GlobalType::UTexture2D;
}
else
{
return GlobalType::UObjectUnknown;
}
}
UObject* UObjectFactory::Create(std::string name)
{
return Create(NameToType(name));
}
UObject* UObjectFactory::Create(GlobalType Type)
{
if (Type == GlobalType::None)
{
return new UObjectNone; /// special UE null-object
}
else if (Type == GlobalType::UObject)
{
return new UObject;
}
else if (Type == GlobalType::UField)
{
return new UField;
}
else if (Type == GlobalType::UConst)
{
return new UConst;
}
else if (Type == GlobalType::UEnum)
{
return new UEnum;
}
else if (Type == GlobalType::UProperty)
{
return new UProperty;
}
else if (Type == GlobalType::UByteProperty)
{
return new UByteProperty;
}
else if (Type == GlobalType::UIntProperty)
{
return new UIntProperty;
}
else if (Type == GlobalType::UBoolProperty)
{
return new UBoolProperty;
}
else if (Type == GlobalType::UFloatProperty)
{
return new UFloatProperty;
}
else if (Type == GlobalType::UObjectProperty)
{
return new UObjectProperty;
}
else if (Type == GlobalType::UClassProperty)
{
return new UClassProperty;
}
else if (Type == GlobalType::UComponentProperty)
{
return new UComponentProperty;
}
else if (Type == GlobalType::UNameProperty)
{
return new UNameProperty;
}
else if (Type == GlobalType::UStructProperty)
{
return new UStructProperty;
}
else if (Type == GlobalType::UStrProperty)
{
return new UStrProperty;
}
else if (Type == GlobalType::UArrayProperty)
{
return new UArrayProperty;
}
else if (Type == GlobalType::UFixedArrayProperty)
{
return new UFixedArrayProperty;
}
else if (Type == GlobalType::UDelegateProperty)
{
return new UDelegateProperty;
}
else if (Type == GlobalType::UInterfaceProperty)
{
return new UInterfaceProperty;
}
else if (Type == GlobalType::UMapProperty)
{
return new UMapProperty;
}
else if (Type == GlobalType::UStruct)
{
return new UStruct;
}
else if (Type == GlobalType::UScriptStruct)
{
return new UScriptStruct;
}
else if (Type == GlobalType::UFunction)
{
return new UFunction;
}
else if (Type == GlobalType::UState)
{
return new UState;
}
else if (Type == GlobalType::UClass)
{
return new UClass;
}
else if (Type == GlobalType::ULevel)
{
return new ULevel;
}
else if (Type == GlobalType::USurface)
{
return new USurface;
}
else if (Type == GlobalType::UTexture)
{
return new UTexture;
}
else if (Type == GlobalType::UTexture2D)
{
return new UTexture2D;
}
else
{
return new UObjectUnknown; /// special unknown object
}
}