Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XPathSelectionIterator.cs
Go to the documentation of this file.
2
4
6{
8
9 private readonly Query _query;
10
11 private int _position;
12
13 public override int Count => _query.Count;
14
15 public override XPathNavigator Current => _nav;
16
17 public override int CurrentPosition => _position;
18
20 {
21 _nav = nav.Clone();
22 _query = query;
23 }
24
31
32 public override void Reset()
33 {
34 _query.Reset();
35 }
36
37 public override bool MoveNext()
38 {
39 XPathNavigator xPathNavigator = _query.Advance();
40 if (xPathNavigator != null)
41 {
42 _position++;
43 if (!_nav.MoveTo(xPathNavigator))
44 {
45 _nav = xPathNavigator.Clone();
46 }
47 return true;
48 }
49 return false;
50 }
51
52 public override XPathNodeIterator Clone()
53 {
54 return new XPathSelectionIterator(this);
55 }
56}
XPathNavigator Advance()
static Query Clone(Query input)
Definition Query.cs:66
XPathSelectionIterator(XPathNavigator nav, Query query)
bool MoveTo(XPathNavigator other)