Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
FieldDefinition.cs
Go to the documentation of this file.
2
4
5public readonly struct FieldDefinition
6{
7 private readonly MetadataReader _reader;
8
9 private readonly uint _treatmentAndRowId;
10
11 private int RowId => (int)(_treatmentAndRowId & 0xFFFFFF);
12
14
16
18 {
19 get
20 {
21 if (Treatment == FieldDefTreatment.None)
22 {
24 }
25 return GetProjectedName();
26 }
27 }
28
30 {
31 get
32 {
33 if (Treatment == FieldDefTreatment.None)
34 {
36 }
37 return GetProjectedFlags();
38 }
39 }
40
42 {
43 get
44 {
45 if (Treatment == FieldDefTreatment.None)
46 {
48 }
49 return GetProjectedSignature();
50 }
51 }
52
53 internal FieldDefinition(MetadataReader reader, uint treatmentAndRowId)
54 {
55 _reader = reader;
56 _treatmentAndRowId = treatmentAndRowId;
57 }
58
60 {
63 return signatureDecoder.DecodeFieldSignature(ref blobReader);
64 }
65
70
75
77 {
79 if (num == 0)
80 {
81 return 0;
82 }
83 return _reader.FieldRvaTable.GetRva(num);
84 }
85
86 public int GetOffset()
87 {
89 if (num == 0)
90 {
91 return -1;
92 }
94 if (offset > int.MaxValue)
95 {
96 return -1;
97 }
98 return (int)offset;
99 }
100
102 {
104 if (num == 0)
105 {
106 return default(BlobHandle);
107 }
109 }
110
115
117 {
119 }
120
122 {
124 if (Treatment == FieldDefTreatment.EnumValue)
125 {
126 return (flags & ~FieldAttributes.FieldAccessMask) | FieldAttributes.Public;
127 }
128 return flags;
129 }
130
135}
TypeDefinitionHandle GetDeclaringType(MethodDefinitionHandle methodDef)
BlobReader GetBlobReader(BlobHandle handle)
ConstantHandle FindConstant(EntityHandle parentHandle)
FieldAttributes GetFlags(FieldDefinitionHandle handle)
BlobHandle GetSignature(FieldDefinitionHandle handle)
StringHandle GetName(FieldDefinitionHandle handle)
TType DecodeFieldSignature(ref BlobReader blobReader)
static FieldDefinitionHandle FromRowId(int rowId)
CustomAttributeHandleCollection GetCustomAttributes()
FieldDefinition(MetadataReader reader, uint treatmentAndRowId)
TType DecodeSignature< TType, TGenericContext >(ISignatureTypeProvider< TType, TGenericContext > provider, TGenericContext genericContext)