MCPcopy Create free account
hub / github.com/Tencent/xLua / defineImplementMethod

Method defineImplementMethod

Assets/XLua/Src/CodeEmit.cs:628–644  ·  view source on GitHub ↗
(TypeBuilder type_builder, MethodInfo to_be_impl, MethodAttributes attributes, string methodName = null)

Source from the content-addressed store, hash-verified

626 }
627
628 private MethodBuilder defineImplementMethod(TypeBuilder type_builder, MethodInfo to_be_impl, MethodAttributes attributes, string methodName = null)
629 {
630 var parameters = to_be_impl.GetParameters();
631
632 Type[] param_types = new Type[parameters.Length];
633 for (int i = 0; i < parameters.Length; ++i)
634 {
635 param_types[i] = parameters[i].ParameterType;
636 }
637
638 var method_builder = type_builder.DefineMethod(methodName == null ? to_be_impl.Name : methodName, attributes, to_be_impl.ReturnType, param_types);
639 for (int i = 0; i < parameters.Length; ++i)
640 {
641 method_builder.DefineParameter(i + 1, parameters[i].Attributes, parameters[i].Name);
642 }
643 return method_builder;
644 }
645
646 ConstructorInfo decimalConstructor = typeof(decimal).GetConstructor(new Type[] {
647 typeof(int), typeof(int), typeof(int), typeof(bool), typeof(byte)

Callers

nothing calls this directly

Calls 1

GetParametersMethod · 0.80

Tested by

no test coverage detected