Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ActionFrame.cs
Go to the documentation of this file.
6
8
9internal sealed class ActionFrame
10{
12 {
13 public override XPathNavigator Current => ((SortKey)list[index - 1]).Node;
14
19
24
25 public override XPathNodeIterator Clone()
26 {
27 return new XPathSortArrayIterator(this);
28 }
29 }
30
31 private int _state;
32
33 private int _counter;
34
35 private object[] _variables;
36
38
39 private Action _action;
40
42
43 private int _currentAction;
44
46
48
50
51 private string _storedOutput;
52
54 {
55 get
56 {
57 return _calulatedName;
58 }
59 set
60 {
62 }
63 }
64
65 internal string StoredOutput
66 {
67 get
68 {
69 return _storedOutput;
70 }
71 set
72 {
74 }
75 }
76
77 internal int State
78 {
79 get
80 {
81 return _state;
82 }
83 set
84 {
85 _state = value;
86 }
87 }
88
89 internal int Counter
90 {
91 get
92 {
93 return _counter;
94 }
95 set
96 {
98 }
99 }
100
102 {
103 get
104 {
105 if (_nodeSet != null)
106 {
107 return _nodeSet.Current;
108 }
109 return null;
110 }
111 }
112
114
116
117 internal int IncrementCounter()
118 {
119 return ++_counter;
120 }
121
122 internal void AllocateVariables(int count)
123 {
124 if (0 < count)
125 {
126 _variables = new object[count];
127 }
128 else
129 {
130 _variables = null;
131 }
132 }
133
134 internal object GetVariable(int index)
135 {
136 return _variables[index];
137 }
138
139 internal void SetVariable(int index, object value)
140 {
142 }
143
144 internal void SetParameter(XmlQualifiedName name, object value)
145 {
146 if (_withParams == null)
147 {
148 _withParams = new Hashtable();
149 }
150 _withParams[name] = value;
151 }
152
153 internal void ResetParams()
154 {
155 if (_withParams != null)
156 {
158 }
159 }
160
161 internal object GetParameter(XmlQualifiedName name)
162 {
163 if (_withParams != null)
164 {
165 return _withParams[name];
166 }
167 return null;
168 }
169
171 {
173 }
174
175 [MemberNotNull("_newNodeSet")]
177 {
179 }
180
181 [MemberNotNull("_newNodeSet")]
183 {
184 int count = sortarray.Count;
186 for (int i = 0; i < count; i++)
187 {
188 Sort sort = (Sort)sortarray[i];
189 Query compiledQuery = proc.GetCompiledQuery(sort.select);
190 xPathSortComparer.AddSort(compiledQuery, new XPathComparerHelper(sort.order, sort.caseOrder, sort.lang, sort.dataType));
191 }
193 while (NewNextNode(proc))
194 {
198 for (int j = 0; j < count; j++)
199 {
200 sortKey[j] = xPathSortComparer.Expression(j).Evaluate(_newNodeSet);
201 }
204 }
207 }
208
209 internal void Finished()
210 {
211 State = -1;
212 }
213
214 internal void Inherit(ActionFrame parent)
215 {
216 _variables = parent._variables;
217 }
218
220 {
221 _state = 0;
222 _action = action;
223 _container = container;
224 _currentAction = 0;
226 _newNodeSet = null;
227 }
228
230 {
231 Init(action, null, nodeSet);
232 }
233
238
239 internal void SetAction(Action action)
240 {
241 SetAction(action, 0);
242 }
243
244 internal void SetAction(Action action, int state)
245 {
246 _action = action;
247 _state = state;
248 }
249
251 {
252 return ((ContainerAction)_action).GetAction(actionIndex);
253 }
254
255 internal void Exit()
256 {
257 Finished();
258 _container = null;
259 }
260
261 [MemberNotNullWhen(false, "_action")]
263 {
264 if (_action == null)
265 {
266 return true;
267 }
269 if (State == -1)
270 {
271 if (_container != null)
272 {
275 State = 0;
276 }
277 else
278 {
279 _action = null;
280 }
281 return _action == null;
282 }
283 return false;
284 }
285
286 internal bool NextNode(Processor proc)
287 {
288 bool flag = _nodeSet.MoveNext();
289 if (flag && proc.Stylesheet.Whitespace)
290 {
292 if (nodeType == XPathNodeType.Whitespace)
293 {
295 bool flag2;
296 do
297 {
299 xPathNavigator.MoveToParent();
300 flag2 = !proc.Stylesheet.PreserveWhiteSpace(proc, xPathNavigator) && (flag = _nodeSet.MoveNext());
301 nodeType = _nodeSet.Current.NodeType;
302 }
303 while (flag2 && nodeType == XPathNodeType.Whitespace);
304 }
305 }
306 return flag;
307 }
308
310 {
311 bool flag = _newNodeSet.MoveNext();
312 if (flag && proc.Stylesheet.Whitespace)
313 {
315 if (nodeType == XPathNodeType.Whitespace)
316 {
318 bool flag2;
319 do
320 {
322 xPathNavigator.MoveToParent();
323 flag2 = !proc.Stylesheet.PreserveWhiteSpace(proc, xPathNavigator) && (flag = _newNodeSet.MoveNext());
324 nodeType = _newNodeSet.Current.NodeType;
325 }
326 while (flag2 && nodeType == XPathNodeType.Whitespace);
327 }
328 }
329 return flag;
330 }
331}
void Add(TKey key, TValue value)
void SortNewNodeSet(Processor proc, ArrayList sortarray)
void Init(Action action, ActionFrame container, XPathNodeIterator nodeSet)
object GetParameter(XmlQualifiedName name)
void SetVariable(int index, object value)
Action GetAction(int actionIndex)
void Inherit(ActionFrame parent)
void InitNodeSet(XPathNodeIterator nodeSet)
void SetAction(Action action, int state)
bool Execute(Processor processor)
bool NewNextNode(Processor proc)
void InitNewNodeSet(XPathNodeIterator nodeSet)
void Init(ActionFrame containerFrame, XPathNodeIterator nodeSet)
void SetParameter(XmlQualifiedName name, object value)
void Init(Action action, XPathNodeIterator nodeSet)
void Execute(Processor processor, ActionFrame frame)