(RealStatePtr L)
| 846 | |
| 847 | |
| 848 | [MonoPInvokeCallback(typeof(LuaCSFunction))] |
| 849 | public static int ImportType(RealStatePtr L) |
| 850 | { |
| 851 | try |
| 852 | { |
| 853 | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| 854 | string className = LuaAPI.lua_tostring(L, 1); |
| 855 | Type type = translator.FindType(className); |
| 856 | if (type != null) |
| 857 | { |
| 858 | if (translator.GetTypeId(L, type) >= 0) |
| 859 | { |
| 860 | LuaAPI.lua_pushboolean(L, true); |
| 861 | } |
| 862 | else |
| 863 | { |
| 864 | return LuaAPI.luaL_error(L, "can not load type " + type); |
| 865 | } |
| 866 | } |
| 867 | else |
| 868 | { |
| 869 | LuaAPI.lua_pushnil(L); |
| 870 | } |
| 871 | return 1; |
| 872 | } |
| 873 | catch (System.Exception e) |
| 874 | { |
| 875 | return LuaAPI.luaL_error(L, "c# exception in xlua.import_type:" + e); |
| 876 | } |
| 877 | } |
| 878 | |
| 879 | [MonoPInvokeCallback(typeof(LuaCSFunction))] |
| 880 | public static int ImportGenericType(RealStatePtr L) |
nothing calls this directly
no test coverage detected