Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
NewArrayInstruction.cs
Go to the documentation of this file.
2
3internal sealed class NewArrayInstruction : Instruction
4{
5 private readonly Type _elementType;
6
7 public override int ConsumedStack => 1;
8
9 public override int ProducedStack => 1;
10
11 public override string InstructionName => "NewArray";
12
17
18 public override int Run(InterpretedFrame frame)
19 {
20 int num = ConvertHelper.ToInt32NoNull(frame.Pop());
21 frame.Push((num < 0) ? new int[num] : Array.CreateInstance(_elementType, num));
22 return 1;
23 }
24}
static unsafe Array CreateInstance(Type elementType, int length)
Definition Array.cs:473