Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
TypeAsInstruction.cs
Go to the documentation of this file.
2
3internal sealed class TypeAsInstruction : Instruction
4{
5 private readonly Type _type;
6
7 public override int ConsumedStack => 1;
8
9 public override int ProducedStack => 1;
10
11 public override string InstructionName => "TypeAs";
12
14 {
15 _type = type;
16 }
17
18 public override int Run(InterpretedFrame frame)
19 {
20 object obj = frame.Pop();
21 frame.Push(_type.IsInstanceOfType(obj) ? obj : null);
22 return 1;
23 }
24
25 public override string ToString()
26 {
27 return "TypeAs " + _type.ToString();
28 }
29}
virtual bool IsInstanceOfType([NotNullWhen(true)] object? o)
Definition Type.cs:1020
override string ToString()
Definition Type.cs:1108