Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ValueOfAction.cs
Go to the documentation of this file.
2
4{
5 private int _selectKey = -1;
6
8
9 private static readonly Action s_BuiltInRule = new BuiltInRuleTextAction();
10
11 internal static Action BuiltInRule()
12 {
13 return s_BuiltInRule;
14 }
15
16 internal override void Compile(Compiler compiler)
17 {
21 }
22
23 internal override bool CompileAttribute(Compiler compiler)
24 {
25 string localName = compiler.Input.LocalName;
26 string value = compiler.Input.Value;
27 if (Ref.Equal(localName, compiler.Atoms.Select))
28 {
29 _selectKey = compiler.AddQuery(value);
30 }
31 else
32 {
33 if (!Ref.Equal(localName, compiler.Atoms.DisableOutputEscaping))
34 {
35 return false;
36 }
38 }
39 return true;
40 }
41
42 internal override void Execute(Processor processor, ActionFrame frame)
43 {
44 switch (frame.State)
45 {
46 case 0:
47 {
48 string text = processor.ValueOf(frame, _selectKey);
50 {
51 frame.Finished();
52 break;
53 }
55 frame.State = 2;
56 break;
57 }
58 case 2:
59 processor.TextEvent(frame.StoredOutput);
60 frame.Finished();
61 break;
62 }
63 }
64}
static bool Equal(string strA, string strB)
Definition Ref.cs:5
void CompileAttributes(Compiler compiler)
void CheckRequiredAttribute(Compiler compiler, object attrValue, string attrName)
static readonly Action s_BuiltInRule
override void Compile(Compiler compiler)
override bool CompileAttribute(Compiler compiler)
override void Execute(Processor processor, ActionFrame frame)