Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
AxisStack.cs
Go to the documentation of this file.
2
3namespace System.Xml.Schema;
4
5internal sealed class AxisStack
6{
7 private readonly ArrayList _stack;
8
9 private readonly ForwardAxis _subtree;
10
11 private readonly ActiveAxis _parent;
12
14
15 internal int Length => _stack.Count;
16
18 {
20 _stack = new ArrayList();
21 _parent = parent;
22 if (!faxis.IsDss)
23 {
24 Push(1);
25 }
26 }
27
28 internal void Push(int depth)
29 {
32 }
33
34 internal void Pop()
35 {
37 }
38
39 internal static bool Equal(string thisname, string thisURN, string name, string URN)
40 {
41 if (thisURN == null)
42 {
43 if (URN != null && URN.Length != 0)
44 {
45 return false;
46 }
47 }
48 else if (thisURN.Length != 0 && thisURN != URN)
49 {
50 return false;
51 }
52 if (thisname.Length != 0 && thisname != name)
53 {
54 return false;
55 }
56 return true;
57 }
58
59 internal void MoveToParent(string name, string URN, int depth)
60 {
62 {
63 for (int i = 0; i < _stack.Count; i++)
64 {
65 ((AxisElement)_stack[i]).MoveToParent(depth, _subtree);
66 }
68 {
69 Pop();
70 }
71 }
72 }
73
74 internal bool MoveToChild(string name, string URN, int depth)
75 {
76 bool result = false;
78 {
79 Push(-1);
80 }
81 for (int i = 0; i < _stack.Count; i++)
82 {
83 if (((AxisElement)_stack[i]).MoveToChild(name, URN, depth, _subtree))
84 {
85 result = true;
86 }
87 }
88 return result;
89 }
90
91 internal bool MoveToAttribute(string name, string URN, int depth)
92 {
94 {
95 return false;
96 }
98 {
99 return false;
100 }
101 bool result = false;
102 if (_subtree.TopNode.Input == null)
103 {
104 if (!_subtree.IsDss)
105 {
106 return depth == 1;
107 }
108 return true;
109 }
110 for (int i = 0; i < _stack.Count; i++)
111 {
113 if (axisElement.isMatch && axisElement.CurNode == _subtree.TopNode.Input)
114 {
115 result = true;
116 }
117 }
118 return result;
119 }
120}
virtual int Add(object? value)
virtual void RemoveAt(int index)
bool MoveToAttribute(string name, string URN, int depth)
Definition AxisStack.cs:91
readonly ForwardAxis _subtree
Definition AxisStack.cs:9
readonly ArrayList _stack
Definition AxisStack.cs:7
bool MoveToChild(string name, string URN, int depth)
Definition AxisStack.cs:74
void MoveToParent(string name, string URN, int depth)
Definition AxisStack.cs:59
static bool Equal(string thisname, string thisURN, string name, string URN)
Definition AxisStack.cs:39
readonly ActiveAxis _parent
Definition AxisStack.cs:11
AxisStack(ForwardAxis faxis, ActiveAxis parent)
Definition AxisStack.cs:17