Exemplo n.º 1
0
        public void Get(RealStatePtr L, int index, out IFramework.Hotfix.Lua.Pedding val)
        {
            LuaTypes type = LuaAPI.lua_type(L, index);

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

                IntPtr buff = LuaAPI.lua_touserdata(L, index); if (!CopyByValue.UnPack(buff, 0, out val))
                {
                    throw new Exception("unpack fail for IFramework.Hotfix.Lua.Pedding");
                }
            }
            else if (type == LuaTypes.LUA_TTABLE)
            {
                CopyByValue.UnPack(this, L, index, out val);
            }
            else
            {
                val = (IFramework.Hotfix.Lua.Pedding)objectCasters.GetCaster(typeof(IFramework.Hotfix.Lua.Pedding))(L, index, null);
            }
        }
Exemplo n.º 2
0
        public static bool Pack(IntPtr buff, int offset, IFramework.Hotfix.Lua.Pedding field)
        {
            if (!Pack(buff, offset, field.c))
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 3
0
        public static bool UnPack(IntPtr buff, int offset, out IFramework.Hotfix.Lua.Pedding field)
        {
            field = default(IFramework.Hotfix.Lua.Pedding);

            if (!UnPack(buff, offset, out field.c))
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 4
0
        public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out IFramework.Hotfix.Lua.Pedding val)
        {
            val = new IFramework.Hotfix.Lua.Pedding();
            int top = LuaAPI.lua_gettop(L);

            if (Utils.LoadField(L, idx, "c"))
            {
                translator.Get(L, top + 1, out val.c);
            }
            LuaAPI.lua_pop(L, 1);
        }
Exemplo n.º 5
0
        public void PushIFrameworkHotfixLuaPedding(RealStatePtr L, IFramework.Hotfix.Lua.Pedding val)
        {
            if (IFrameworkHotfixLuaPedding_TypeID == -1)
            {
                bool is_first;
                IFrameworkHotfixLuaPedding_TypeID = getTypeId(L, typeof(IFramework.Hotfix.Lua.Pedding), out is_first);
            }

            IntPtr buff = LuaAPI.xlua_pushstruct(L, 1, IFrameworkHotfixLuaPedding_TypeID);

            if (!CopyByValue.Pack(buff, 0, val))
            {
                throw new Exception("pack fail fail for IFramework.Hotfix.Lua.Pedding ,value=" + val);
            }
        }
Exemplo n.º 6
0
        public void UpdateIFrameworkHotfixLuaPedding(RealStatePtr L, int index, IFramework.Hotfix.Lua.Pedding val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
                if (LuaAPI.xlua_gettypeid(L, index) != IFrameworkHotfixLuaPedding_TypeID)
                {
                    throw new Exception("invalid userdata for IFramework.Hotfix.Lua.Pedding");
                }

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

            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }