Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros
LocalVariable.cs
Go to the documentation of this file.
3
5
6internal sealed class LocalVariable
7{
8 public readonly int Index;
9
10 private int _flags;
11
12 public bool IsBoxed
13 {
14 get
15 {
16 return (_flags & 1) != 0;
17 }
18 set
19 {
20 if (value)
21 {
22 _flags |= 1;
23 }
24 else
25 {
26 _flags &= -2;
27 }
28 }
29 }
30
31 public bool InClosure => (_flags & 2) != 0;
32
33 internal LocalVariable(int index, bool closure)
34 {
35 Index = index;
36 _flags = (closure ? 2 : 0);
37 }
38
39 public override string ToString()
40 {
42 DefaultInterpolatedStringHandler handler = new DefaultInterpolatedStringHandler(3, 3, invariantCulture);
43 handler.AppendFormatted(Index);
44 handler.AppendLiteral(": ");
45 handler.AppendFormatted(IsBoxed ? "boxed" : null);
46 handler.AppendLiteral(" ");
47 handler.AppendFormatted(InClosure ? "in closure" : null);
48 return string.Create(invariantCulture, ref handler);
49 }
50}
static CultureInfo InvariantCulture