Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
EnumModel.cs
Go to the documentation of this file.
4
6
7internal sealed class EnumModel : TypeModel
8{
10
12 {
13 get
14 {
15 if (_constants == null)
16 {
18 FieldInfo[] fields = base.Type.GetFields();
19 foreach (FieldInfo fieldInfo in fields)
20 {
22 if (constantModel != null)
23 {
25 }
26 }
27 _constants = list.ToArray();
28 }
29 return _constants;
30 }
31 }
32
37
39 {
40 if (fieldInfo.IsSpecialName)
41 {
42 return null;
43 }
44 return new ConstantModel(fieldInfo, ((IConvertible)fieldInfo.GetValue(null)).ToInt64(null));
45 }
46}
EnumModel([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, TypeDesc typeDesc, ModelScope scope)
Definition EnumModel.cs:33
ConstantModel GetConstantModel(FieldInfo fieldInfo)
Definition EnumModel.cs:38