Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
FollowingQuery.cs
Go to the documentation of this file.
2
4
5internal sealed class FollowingQuery : BaseAxisQuery
6{
8
10
11 public FollowingQuery(Query qyInput, string name, string prefix, XPathNodeType typeTest)
12 : base(qyInput, name, prefix, typeTest)
13 {
14 }
15
17 : base(other)
18 {
19 _input = Query.Clone(other._input);
20 _iterator = Query.Clone(other._iterator);
21 }
22
23 public override void Reset()
24 {
25 _iterator = null;
26 base.Reset();
27 }
28
29 public override XPathNavigator Advance()
30 {
31 if (_iterator == null)
32 {
34 if (_input == null)
35 {
36 return null;
37 }
38 XPathNavigator xPathNavigator;
39 do
40 {
41 xPathNavigator = _input.Clone();
43 }
44 while (xPathNavigator.IsDescendant(_input));
45 _input = xPathNavigator;
47 }
48 while (!_iterator.MoveNext())
49 {
50 bool matchSelf;
51 if (_input.NodeType == XPathNodeType.Attribute || _input.NodeType == XPathNodeType.Namespace)
52 {
54 matchSelf = false;
55 }
56 else
57 {
58 while (!_input.MoveToNext())
59 {
60 if (!_input.MoveToParent())
61 {
62 return null;
63 }
64 }
65 matchSelf = true;
66 }
67 if (base.NameTest)
68 {
69 _iterator = _input.SelectDescendants(base.Name, base.Namespace, matchSelf);
70 }
71 else
72 {
73 _iterator = _input.SelectDescendants(base.TypeTest, matchSelf);
74 }
75 }
76 position++;
78 return currentNode;
79 }
80
81 public override XPathNodeIterator Clone()
82 {
83 return new FollowingQuery(this);
84 }
85}
override XPathNavigator Advance()
FollowingQuery(Query qyInput, string name, string prefix, XPathNodeType typeTest)
override XPathNodeIterator Clone()
XPathNavigator Advance()
static Query Clone(Query input)
Definition Query.cs:66
virtual XPathNodeIterator SelectDescendants(XPathNodeType type, bool matchSelf)
virtual bool IsDescendant([NotNullWhen(true)] XPathNavigator? nav)