Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
AxisElement.cs
Go to the documentation of this file.
1namespace System.Xml.Schema;
2
3internal sealed class AxisElement
4{
6
7 internal int rootDepth;
8
9 internal int curDepth;
10
11 internal bool isMatch;
12
14
15 internal AxisElement(DoubleLinkAxis node, int depth)
16 {
17 curNode = node;
18 rootDepth = (curDepth = depth);
19 isMatch = false;
20 }
21
22 internal void SetDepth(int depth)
23 {
24 rootDepth = (curDepth = depth);
25 }
26
27 internal void MoveToParent(int depth, ForwardAxis parent)
28 {
29 if (depth == curDepth - 1)
30 {
31 if (curNode.Input == parent.RootNode && parent.IsDss)
32 {
33 curNode = parent.RootNode;
34 rootDepth = (curDepth = -1);
35 }
36 else if (curNode.Input != null)
37 {
39 curDepth--;
40 }
41 }
42 else if (depth == curDepth && isMatch)
43 {
44 isMatch = false;
45 }
46 }
47
48 internal bool MoveToChild(string name, string URN, int depth, ForwardAxis parent)
49 {
51 {
52 return false;
53 }
54 if (isMatch)
55 {
56 isMatch = false;
57 }
59 {
60 return false;
61 }
62 if (curDepth == -1)
63 {
64 SetDepth(depth);
65 }
66 else if (depth > curDepth)
67 {
68 return false;
69 }
70 if (curNode == parent.TopNode)
71 {
72 isMatch = true;
73 return true;
74 }
77 {
78 isMatch = true;
79 return false;
80 }
81 curNode = ast;
82 curDepth++;
83 return false;
84 }
85}
static bool IsAttribute(Axis ast)
Definition Asttree.cs:36
bool MoveToChild(string name, string URN, int depth, ForwardAxis parent)
void MoveToParent(int depth, ForwardAxis parent)
AxisElement(DoubleLinkAxis node, int depth)
static bool Equal(string thisname, string thisURN, string name, string URN)
Definition AxisStack.cs:39