Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SequencePointCollection.cs
Go to the documentation of this file.
5
7
8public readonly struct SequencePointCollection : IEnumerable<SequencePoint>, IEnumerable
9{
10 public struct Enumerator : IEnumerator<SequencePoint>, IEnumerator, IDisposable
11 {
13
15
17
19
21
22 object IEnumerator.Current => _current;
23
31
32 public bool MoveNext()
33 {
34 if (_reader.RemainingBytes == 0)
35 {
36 return false;
37 }
39 int offset;
40 if (_reader.Offset == 0)
41 {
43 if (document.IsNil)
44 {
46 }
48 }
49 else
50 {
51 int delta;
52 while ((delta = _reader.ReadCompressedInteger()) == 0)
53 {
55 }
57 }
59 if (deltaLines == 0 && deltaColumns == 0)
60 {
62 return true;
63 }
64 int num;
65 ushort num2;
67 {
68 num = ReadLine();
69 num2 = ReadColumn();
70 }
71 else
72 {
75 }
79 return true;
80 }
81
87
88 private int ReadLine()
89 {
91 }
92
93 private ushort ReadColumn()
94 {
96 if (num > 65535)
97 {
99 }
100 return (ushort)num;
101 }
102
103 private int AddOffsets(int value, int delta)
104 {
105 int num = value + delta;
106 if (num < 0)
107 {
109 }
110 return num;
111 }
112
113 private int AddLines(int value, int delta)
114 {
115 int num = value + delta;
116 if (num < 0 || num >= 16707566)
117 {
119 }
120 return num;
121 }
122
123 private ushort AddColumns(ushort value, int delta)
124 {
125 int num = value + delta;
126 if (num < 0 || num >= 65535)
127 {
129 }
130 return (ushort)num;
131 }
132
134 {
135 int num = _reader.ReadCompressedInteger();
136 if (num == 0 || !TokenTypeIds.IsValidRowId(num))
137 {
139 }
140 return DocumentHandle.FromRowId(num);
141 }
142
143 public void Reset()
144 {
145 _reader.Reset();
146 _current = default(SequencePoint);
147 }
148
150 {
151 }
152 }
153
154 private readonly MemoryBlock _block;
155
156 private readonly DocumentHandle _document;
157
163
165 {
166 return new Enumerator(_block, _document);
167 }
168
173
178}
static void InvalidHandle()
Definition Throw.cs:208
static void SequencePointValueOutOfRange()
Definition Throw.cs:285
new IEnumerator< T > GetEnumerator()
static DocumentHandle FromRowId(int rowId)
void ReadDeltaLinesAndColumns(out int deltaLines, out int deltaColumns)
SequencePointCollection(MemoryBlock block, DocumentHandle document)