(RealStatePtr L)
| 1143 | } |
| 1144 | |
| 1145 | [MonoPInvokeCallback(typeof(LuaCSFunction))] |
| 1146 | public static int GenericMethodWraper(RealStatePtr L) |
| 1147 | { |
| 1148 | try |
| 1149 | { |
| 1150 | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| 1151 | MethodInfo genericMethod; |
| 1152 | translator.Get(L, LuaAPI.xlua_upvalueindex(1), out genericMethod); |
| 1153 | int n = LuaAPI.lua_gettop(L); |
| 1154 | Type[] typeArguments = new Type[n]; |
| 1155 | for(int i = 0; i < n; i++) |
| 1156 | { |
| 1157 | Type type = getType(L, translator, i + 1); |
| 1158 | if (type == null) |
| 1159 | { |
| 1160 | return LuaAPI.luaL_error(L, "param #" + (i + 1) + " is not a type"); |
| 1161 | } |
| 1162 | typeArguments[i] = type; |
| 1163 | } |
| 1164 | var method = genericMethod.MakeGenericMethod(typeArguments); |
| 1165 | translator.PushFixCSFunction(L, |
| 1166 | new LuaCSFunction(translator.methodWrapsCache._GenMethodWrap(method.DeclaringType, method.Name, new MethodBase[] { method }).Call)); |
| 1167 | return 1; |
| 1168 | } |
| 1169 | catch (Exception e) |
| 1170 | { |
| 1171 | return LuaAPI.luaL_error(L, "c# exception in GenericMethodWraper: " + e); |
| 1172 | } |
| 1173 | } |
| 1174 | |
| 1175 | [MonoPInvokeCallback(typeof(LuaCSFunction))] |
| 1176 | public static int GetGenericMethod(RealStatePtr L) |
nothing calls this directly
no test coverage detected