Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
MethodTable.cs
Go to the documentation of this file.
2
4
5[StructLayout(LayoutKind.Explicit)]
6internal struct MethodTable
7{
8 [FieldOffset(0)]
9 public ushort ComponentSize;
10
11 [FieldOffset(0)]
12 private uint Flags;
13
14 [FieldOffset(4)]
15 public uint BaseSize;
16
17 [FieldOffset(14)]
18 public ushort InterfaceCount;
19
20 [FieldOffset(16)]
22
23 [FieldOffset(48)]
24 public unsafe void* ElementType;
25
26 [FieldOffset(56)]
27 public unsafe MethodTable** InterfaceMap;
28
29 public bool HasComponentSize => (Flags & 0x80000000u) != 0;
30
31 public bool ContainsGCPointers => (Flags & 0x1000000) != 0;
32
33 public bool NonTrivialInterfaceCast => (Flags & 0x406C0000) != 0;
34
35 public unsafe bool IsMultiDimensionalArray
36 {
37 [MethodImpl(MethodImplOptions.AggressiveInlining)]
38 get
39 {
40 return BaseSize > (uint)(3 * sizeof(IntPtr));
41 }
42 }
43
44 public unsafe int MultiDimensionalArrayRank
45 {
46 [MethodImpl(MethodImplOptions.AggressiveInlining)]
47 get
48 {
49 return (int)((uint)((int)BaseSize - 3 * sizeof(IntPtr)) / 8u);
50 }
51 }
52}