Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ActiveAxis.cs
Go to the documentation of this file.
2
3namespace System.Xml.Schema;
4
5internal class ActiveAxis
6{
7 private int _currentDepth;
8
9 private bool _isActive;
10
11 private readonly Asttree _axisTree;
12
13 private readonly ArrayList _axisStack;
14
16
17 internal void Reactivate()
18 {
19 _isActive = true;
20 _currentDepth = -1;
21 }
22
24 {
26 _currentDepth = -1;
27 _axisStack = new ArrayList(axisTree.SubtreeArray.Count);
28 for (int i = 0; i < axisTree.SubtreeArray.Count; i++)
29 {
30 AxisStack value = new AxisStack((ForwardAxis)axisTree.SubtreeArray[i], this);
32 }
33 _isActive = true;
34 }
35
36 public bool MoveToStartElement(string localname, string URN)
37 {
38 if (!_isActive)
39 {
40 return false;
41 }
43 bool result = false;
44 for (int i = 0; i < _axisStack.Count; i++)
45 {
47 if (axisStack.Subtree.IsSelfAxis)
48 {
49 if (axisStack.Subtree.IsDss || CurrentDepth == 0)
50 {
51 result = true;
52 }
53 }
54 else if (CurrentDepth != 0 && axisStack.MoveToChild(localname, URN, _currentDepth))
55 {
56 result = true;
57 }
58 }
59 return result;
60 }
61
62 public virtual bool EndElement(string localname, string URN)
63 {
64 if (_currentDepth == 0)
65 {
66 _isActive = false;
68 }
69 if (!_isActive)
70 {
71 return false;
72 }
73 for (int i = 0; i < _axisStack.Count; i++)
74 {
75 ((AxisStack)_axisStack[i]).MoveToParent(localname, URN, _currentDepth);
76 }
78 return false;
79 }
80
81 public bool MoveToAttribute(string localname, string URN)
82 {
83 if (!_isActive)
84 {
85 return false;
86 }
87 bool result = false;
88 for (int i = 0; i < _axisStack.Count; i++)
89 {
90 if (((AxisStack)_axisStack[i]).MoveToAttribute(localname, URN, _currentDepth + 1))
91 {
92 result = true;
93 }
94 }
95 return result;
96 }
97}
virtual int Add(object? value)
bool MoveToStartElement(string localname, string URN)
Definition ActiveAxis.cs:36
ActiveAxis(Asttree axisTree)
Definition ActiveAxis.cs:23
readonly ArrayList _axisStack
Definition ActiveAxis.cs:13
virtual bool EndElement(string localname, string URN)
Definition ActiveAxis.cs:62
readonly Asttree _axisTree
Definition ActiveAxis.cs:11
bool MoveToAttribute(string localname, string URN)
Definition ActiveAxis.cs:81