Ejemplo n.º 1
0
        public XLuaTest.MyEnum __Gen_Delegate_Imp7(XLuaTest.MyEnum p0)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
            ObjectTranslator translator = luaEnv.translator;
            translator.PushXLuaTestMyEnum(L, p0);

            PCall(L, 1, 1, errFunc);


            XLuaTest.MyEnum __gen_ret; translator.Get(L, errFunc + 1, out __gen_ret);
            LuaAPI.lua_settop(L, errFunc - 1);
            return(__gen_ret);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Ejemplo n.º 2
0
        static int _m_EnumParamMethod(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            XLuaTest.NoGc __cl_gen_to_be_invoked = (XLuaTest.NoGc)translator.FastGetCSObj(L, 1);


            try {
                {
                    XLuaTest.MyEnum p; translator.Get(L, 2, out p);

                    XLuaTest.MyEnum __cl_gen_ret = __cl_gen_to_be_invoked.EnumParamMethod(p);
                    translator.PushXLuaTestMyEnum(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
        public void Get(RealStatePtr L, int index, out XLuaTest.MyEnum val)
        {
            LuaTypes type = LuaAPI.lua_type(L, index);

            if (type == LuaTypes.LUA_TUSERDATA)
            {
                if (LuaAPI.xlua_gettypeid(L, index) != XLuaTestMyEnum_TypeID)
                {
                    throw new Exception("invalid userdata for XLuaTest.MyEnum");
                }

                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                int    e;
                if (!CopyByValue.UnPack(buff, 0, out e))
                {
                    throw new Exception("unpack fail for XLuaTest.MyEnum");
                }
                val = (XLuaTest.MyEnum)e;
            }
            else
            {
                val = (XLuaTest.MyEnum)objectCasters.GetCaster(typeof(XLuaTest.MyEnum))(L, index, null);
            }
        }