Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XPathDescendantIterator.cs
Go to the documentation of this file.
2
4
6{
7 private int _level;
8
13
14 public XPathDescendantIterator(XPathNavigator nav, string name, string namespaceURI, bool matchSelf)
15 : base(nav, name, namespaceURI, matchSelf)
16 {
17 }
18
20 : base(it)
21 {
22 _level = it._level;
23 }
24
25 public override XPathNodeIterator Clone()
26 {
27 return new XPathDescendantIterator(this);
28 }
29
30 public override bool MoveNext()
31 {
32 if (_level == -1)
33 {
34 return false;
35 }
36 if (first)
37 {
38 first = false;
39 if (matchSelf && Matches)
40 {
41 position = 1;
42 return true;
43 }
44 }
45 do
46 {
48 {
49 _level++;
50 continue;
51 }
52 while (true)
53 {
54 if (_level == 0)
55 {
56 _level = -1;
57 return false;
58 }
59 if (nav.MoveToNext())
60 {
61 break;
62 }
64 _level--;
65 }
66 }
67 while (!Matches);
68 position++;
69 return true;
70 }
71}
XPathDescendantIterator(XPathNavigator nav, XPathNodeType type, bool matchSelf)
XPathDescendantIterator(XPathNavigator nav, string name, string namespaceURI, bool matchSelf)