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

◆ GetArrayAccessor()

static CallInstruction System.Linq.Expressions.Interpreter.CallInstruction.GetArrayAccessor ( MethodInfo info,
int argumentCount )
inlinestaticprivateinherited

Definition at line 75 of file CallInstruction.cs.

76 {
77 Type declaringType = info.DeclaringType;
78 bool flag = info.Name == "Get";
80 switch (declaringType.GetArrayRank())
81 {
82 case 1:
83 methodInfo = (flag ? typeof(Array).GetMethod("GetValue", new Type[1] { typeof(int) }) : typeof(CallInstruction).GetMethod("ArrayItemSetter1"));
84 break;
85 case 2:
86 methodInfo = (flag ? typeof(Array).GetMethod("GetValue", new Type[2]
87 {
88 typeof(int),
89 typeof(int)
90 }) : typeof(CallInstruction).GetMethod("ArrayItemSetter2"));
91 break;
92 case 3:
93 methodInfo = (flag ? typeof(Array).GetMethod("GetValue", new Type[3]
94 {
95 typeof(int),
96 typeof(int),
97 typeof(int)
98 }) : typeof(CallInstruction).GetMethod("ArrayItemSetter3"));
99 break;
100 }
101 if ((object)methodInfo == null)
102 {
103 return new MethodInfoCallInstruction(info, argumentCount);
104 }
105 return Create(methodInfo);
106 }
static CallInstruction Create(MethodInfo info)

References System.Linq.Expressions.Interpreter.CallInstruction.Create(), and System.info.

Referenced by System.Linq.Expressions.Interpreter.CallInstruction.Create().