Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
CopyOfAction.cs
Go to the documentation of this file.
3
5
7{
8 private int _selectKey = -1;
9
10 internal override void Compile(Compiler compiler)
11 {
15 }
16
17 internal override bool CompileAttribute(Compiler compiler)
18 {
19 string localName = compiler.Input.LocalName;
20 string value = compiler.Input.Value;
21 if (Ref.Equal(localName, compiler.Atoms.Select))
22 {
23 _selectKey = compiler.AddQuery(value);
24 return true;
25 }
26 return false;
27 }
28
29 internal override void Execute(Processor processor, ActionFrame frame)
30 {
31 switch (frame.State)
32 {
33 case 0:
34 {
35 Query valueQuery = processor.GetValueQuery(_selectKey);
36 object obj = valueQuery.Evaluate(frame.NodeSet);
38 {
40 frame.State = 3;
41 break;
42 }
43 if (obj is XPathNavigator nav)
44 {
46 frame.State = 3;
47 break;
48 }
50 if (processor.TextEvent(text))
51 {
52 frame.Finished();
53 break;
54 }
56 frame.State = 2;
57 break;
58 }
59 case 2:
60 processor.TextEvent(frame.StoredOutput);
61 frame.Finished();
62 break;
63 case 3:
64 frame.Finished();
65 break;
66 case 1:
67 break;
68 }
69 }
70}
object Evaluate(XPathNodeIterator nodeIterator)
static bool Equal(string strA, string strB)
Definition Ref.cs:5
static string ToXPathString(object value)
void CompileAttributes(Compiler compiler)
void CheckRequiredAttribute(Compiler compiler, object attrValue, string attrName)
override bool CompileAttribute(Compiler compiler)
override void Compile(Compiler compiler)
override void Execute(Processor processor, ActionFrame frame)