Пример #1
0
        public void PushIFrameworkHotfixLuaMyEnum(RealStatePtr L, IFramework.Hotfix.Lua.MyEnum val)
        {
            if (IFrameworkHotfixLuaMyEnum_TypeID == -1)
            {
                bool is_first;
                IFrameworkHotfixLuaMyEnum_TypeID = getTypeId(L, typeof(IFramework.Hotfix.Lua.MyEnum), out is_first);

                if (IFrameworkHotfixLuaMyEnum_EnumRef == -1)
                {
                    Utils.LoadCSTable(L, typeof(IFramework.Hotfix.Lua.MyEnum));
                    IFrameworkHotfixLuaMyEnum_EnumRef = LuaAPI.luaL_ref(L, LuaIndexes.LUA_REGISTRYINDEX);
                }
            }

            if (LuaAPI.xlua_tryget_cachedud(L, (int)val, IFrameworkHotfixLuaMyEnum_EnumRef) == 1)
            {
                return;
            }

            IntPtr buff = LuaAPI.xlua_pushstruct(L, 4, IFrameworkHotfixLuaMyEnum_TypeID);

            if (!CopyByValue.Pack(buff, 0, (int)val))
            {
                throw new Exception("pack fail fail for IFramework.Hotfix.Lua.MyEnum ,value=" + val);
            }

            LuaAPI.lua_getref(L, IFrameworkHotfixLuaMyEnum_EnumRef);
            LuaAPI.lua_pushvalue(L, -2);
            LuaAPI.xlua_rawseti(L, -2, (int)val);
            LuaAPI.lua_pop(L, 1);
        }
Пример #2
0
		public IFramework.Hotfix.Lua.MyEnum __Gen_Delegate_Imp4(IFramework.Hotfix.Lua.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.PushIFrameworkHotfixLuaMyEnum(L, p0);
                
                PCall(L, 1, 1, errFunc);
                
                
                IFramework.Hotfix.Lua.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
		}
Пример #3
0
        public void UpdateIFrameworkHotfixLuaMyEnum(RealStatePtr L, int index, IFramework.Hotfix.Lua.MyEnum val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
                if (LuaAPI.xlua_gettypeid(L, index) != IFrameworkHotfixLuaMyEnum_TypeID)
                {
                    throw new Exception("invalid userdata for IFramework.Hotfix.Lua.MyEnum");
                }

                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                if (!CopyByValue.Pack(buff, 0, (int)val))
                {
                    throw new Exception("pack fail for IFramework.Hotfix.Lua.MyEnum ,value=" + val);
                }
            }

            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }
        static int _m_EnumParamMethod(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                IFramework.Hotfix.Lua.NoGc gen_to_be_invoked = (IFramework.Hotfix.Lua.NoGc)translator.FastGetCSObj(L, 1);



                {
                    IFramework.Hotfix.Lua.MyEnum _p; translator.Get(L, 2, out _p);

                    IFramework.Hotfix.Lua.MyEnum gen_ret = gen_to_be_invoked.EnumParamMethod(_p);
                    translator.PushIFrameworkHotfixLuaMyEnum(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Пример #5
0
        public void Get(RealStatePtr L, int index, out IFramework.Hotfix.Lua.MyEnum val)
        {
            LuaTypes type = LuaAPI.lua_type(L, index);

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

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