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

◆ FastCreate< T0, T1 >()

Definition at line 322 of file CallInstruction.cs.

323 {
325 if (type == null)
326 {
327 if (target.ReturnType == typeof(void))
328 {
329 return new ActionCallInstruction<T0, T1>(target);
330 }
331 return new FuncCallInstruction<T0, T1>(target);
332 }
333 if (type.IsEnum)
334 {
335 return SlowCreate(target, pi);
336 }
337 switch (type.GetTypeCode())
338 {
339 case TypeCode.Object:
340 if (!type.IsValueType)
341 {
342 return new FuncCallInstruction<T0, T1, object>(target);
343 }
344 break;
345 case TypeCode.Int16:
346 return new FuncCallInstruction<T0, T1, short>(target);
347 case TypeCode.Int32:
348 return new FuncCallInstruction<T0, T1, int>(target);
349 case TypeCode.Int64:
350 return new FuncCallInstruction<T0, T1, long>(target);
351 case TypeCode.Boolean:
352 return new FuncCallInstruction<T0, T1, bool>(target);
353 case TypeCode.Char:
354 return new FuncCallInstruction<T0, T1, char>(target);
355 case TypeCode.Byte:
356 return new FuncCallInstruction<T0, T1, byte>(target);
357 case TypeCode.Decimal:
358 return new FuncCallInstruction<T0, T1, decimal>(target);
359 case TypeCode.DateTime:
360 return new FuncCallInstruction<T0, T1, DateTime>(target);
361 case TypeCode.Double:
362 return new FuncCallInstruction<T0, T1, double>(target);
363 case TypeCode.Single:
364 return new FuncCallInstruction<T0, T1, float>(target);
365 case TypeCode.UInt16:
366 return new FuncCallInstruction<T0, T1, ushort>(target);
367 case TypeCode.UInt32:
368 return new FuncCallInstruction<T0, T1, uint>(target);
369 case TypeCode.UInt64:
370 return new FuncCallInstruction<T0, T1, ulong>(target);
371 case TypeCode.String:
372 return new FuncCallInstruction<T0, T1, string>(target);
373 case TypeCode.SByte:
374 return new FuncCallInstruction<T0, T1, sbyte>(target);
375 }
376 return SlowCreate(target, pi);
377 }
static CallInstruction SlowCreate(MethodInfo info, ParameterInfo[] pis)
static Type TryGetParameterOrReturnType(MethodInfo target, ParameterInfo[] pi, int index)

References System.Reflection.MethodInfo.ReturnType, System.Linq.Expressions.Interpreter.CallInstruction.SlowCreate(), System.Linq.Expressions.Interpreter.CallInstruction.TryGetParameterOrReturnType(), and System.type.