Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ReorderArgumentArray() [2/2]

override void System.DefaultBinder.ReorderArgumentArray ( ref object[] args,
object state )
inlinesealedinherited

Definition at line 623 of file DefaultBinder.cs.

624 {
625 BinderState binderState = (BinderState)state;
626 ReorderParams(binderState._argsMap, args);
627 if (binderState._isParamArray)
628 {
629 int num = args.Length - 1;
630 if (args.Length == binderState._originalSize)
631 {
632 args[num] = ((object[])args[num])[0];
633 return;
634 }
635 object[] array = new object[args.Length];
636 Array.Copy(args, array, num);
637 int num2 = num;
638 int num3 = 0;
639 while (num2 < array.Length)
640 {
641 array[num2] = ((object[])args[num])[num3];
642 num2++;
643 num3++;
644 }
645 args = array;
646 }
647 else if (args.Length > binderState._originalSize)
648 {
649 object[] array2 = new object[binderState._originalSize];
650 Array.Copy(args, array2, binderState._originalSize);
651 args = array2;
652 }
653 }
static void ReorderParams(int[] paramOrder, object[] vars)

References System.DefaultBinder.BinderState._argsMap, System.DefaultBinder.BinderState._isParamArray, System.DefaultBinder.BinderState._originalSize, System.array, System.Array.Copy(), System.DefaultBinder.ReorderParams(), and System.state.