Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XmlNodeListEnumerator.cs
Go to the documentation of this file.
2
3namespace System.Xml;
4
5internal sealed class XmlNodeListEnumerator : IEnumerator
6{
7 private readonly XPathNodeList _list;
8
9 private int _index;
10
11 private bool _valid;
12
13 public object Current
14 {
15 get
16 {
17 if (_valid)
18 {
19 return _list[_index];
20 }
21 return null;
22 }
23 }
24
26 {
27 _list = list;
28 _index = -1;
29 _valid = false;
30 }
31
32 public void Reset()
33 {
34 _index = -1;
35 }
36
37 public bool MoveNext()
38 {
39 _index++;
40 int num = _list.ReadUntil(_index + 1);
41 if (num - 1 < _index)
42 {
43 return false;
44 }
45 _valid = _list[_index] != null;
46 return _valid;
47 }
48}