Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
AssemblyReferenceHandleCollection.cs
Go to the documentation of this file.
3
5
6public readonly struct AssemblyReferenceHandleCollection : IReadOnlyCollection<AssemblyReferenceHandle>, IEnumerable<AssemblyReferenceHandle>, IEnumerable
7{
8 public struct Enumerator : IEnumerator<AssemblyReferenceHandle>, IEnumerator, IDisposable
9 {
10 private readonly MetadataReader _reader;
11
12 private int _currentRowId;
13
14 private int _virtualRowId;
15
17 {
18 get
19 {
20 if (_virtualRowId >= 0)
21 {
22 if (_virtualRowId == 16777216)
23 {
24 return default(AssemblyReferenceHandle);
25 }
27 }
29 }
30 }
31
32 object IEnumerator.Current => Current;
33
34 internal Enumerator(MetadataReader reader)
35 {
36 _reader = reader;
37 _currentRowId = 0;
38 _virtualRowId = -1;
39 }
40
41 public bool MoveNext()
42 {
43 if (_currentRowId < _reader.AssemblyRefTable.NumberOfNonVirtualRows)
44 {
46 return true;
47 }
48 if (_virtualRowId < _reader.AssemblyRefTable.NumberOfVirtualRows - 1)
49 {
51 return true;
52 }
53 _currentRowId = 16777216;
54 _virtualRowId = 16777216;
55 return false;
56 }
57
59 {
60 throw new NotSupportedException();
61 }
62
64 {
65 }
66 }
67
68 private readonly MetadataReader _reader;
69
70 public int Count => _reader.AssemblyRefTable.NumberOfNonVirtualRows + _reader.AssemblyRefTable.NumberOfVirtualRows;
71
73 {
74 _reader = reader;
75 }
76
78 {
79 return new Enumerator(_reader);
80 }
81
86
91}
new IEnumerator< T > GetEnumerator()
static AssemblyReferenceHandle FromRowId(int rowId)
static AssemblyReferenceHandle FromVirtualIndex(VirtualIndex virtualIndex)