Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros
ModuleTableReader.cs
Go to the documentation of this file.
2
4
5internal readonly struct ModuleTableReader
6{
7 internal readonly int NumberOfRows;
8
9 private readonly bool _IsStringHeapRefSizeSmall;
10
11 private readonly bool _IsGUIDHeapRefSizeSmall;
12
13 private readonly int _GenerationOffset;
14
15 private readonly int _NameOffset;
16
17 private readonly int _MVIdOffset;
18
19 private readonly int _EnCIdOffset;
20
21 private readonly int _EnCBaseIdOffset;
22
23 internal readonly int RowSize;
24
25 internal readonly MemoryBlock Block;
26
27 internal ModuleTableReader(int numberOfRows, int stringHeapRefSize, int guidHeapRefSize, MemoryBlock containingBlock, int containingBlockOffset)
28 {
29 NumberOfRows = numberOfRows;
30 _IsStringHeapRefSizeSmall = stringHeapRefSize == 2;
31 _IsGUIDHeapRefSizeSmall = guidHeapRefSize == 2;
34 _MVIdOffset = _NameOffset + stringHeapRefSize;
35 _EnCIdOffset = _MVIdOffset + guidHeapRefSize;
36 _EnCBaseIdOffset = _EnCIdOffset + guidHeapRefSize;
37 RowSize = _EnCBaseIdOffset + guidHeapRefSize;
38 Block = containingBlock.GetMemoryBlockAt(containingBlockOffset, RowSize * numberOfRows);
39 }
40
41 internal ushort GetGeneration()
42 {
44 }
45
50
55
60
65}
unsafe ushort PeekUInt16(int offset)
unsafe MemoryBlock GetMemoryBlockAt(int offset, int length)
int PeekHeapReference(int offset, bool smallRefSize)
ModuleTableReader(int numberOfRows, int stringHeapRefSize, int guidHeapRefSize, MemoryBlock containingBlock, int containingBlockOffset)
static GuidHandle FromIndex(int heapIndex)
Definition GuidHandle.cs:18
static StringHandle FromOffset(int heapOffset)