Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XPathSingletonIterator.cs
Go to the documentation of this file.
2
4
6{
7 private readonly XPathNavigator _nav;
8
9 private int _position;
10
11 public override XPathNavigator Current => _nav;
12
13 public override int CurrentPosition => _position;
14
15 public override int Count => 1;
16
18 {
19 _nav = nav;
20 }
21
22 public XPathSingletonIterator(XPathNavigator nav, bool moved)
23 : this(nav)
24 {
25 if (moved)
26 {
27 _position = 1;
28 }
29 }
30
36
37 public override XPathNodeIterator Clone()
38 {
39 return new XPathSingletonIterator(this);
40 }
41
42 public override bool MoveNext()
43 {
44 if (_position == 0)
45 {
46 _position = 1;
47 return true;
48 }
49 return false;
50 }
51
52 public override void Reset()
53 {
54 _position = 0;
55 }
56}
XPathSingletonIterator(XPathNavigator nav, bool moved)