Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
NewArrayInitInstruction.cs
Go to the documentation of this file.
2
3internal sealed class NewArrayInitInstruction : Instruction
4{
5 private readonly Type _elementType;
6
7 private readonly int _elementCount;
8
9 public override int ConsumedStack => _elementCount;
10
11 public override int ProducedStack => 1;
12
13 public override string InstructionName => "NewArrayInit";
14
15 internal NewArrayInitInstruction(Type elementType, int elementCount)
16 {
18 _elementCount = elementCount;
19 }
20
21 public override int Run(InterpretedFrame frame)
22 {
24 for (int num = _elementCount - 1; num >= 0; num--)
25 {
26 array.SetValue(frame.Pop(), num);
27 }
28 frame.Push(array);
29 return 1;
30 }
31}
static unsafe Array CreateInstance(Type elementType, int length)
Definition Array.cs:473