public void Get(RealStatePtr L, int index, out IFramework.Lua.Pedding val) { LuaTypes type = LuaAPI.lua_type(L, index); if (type == LuaTypes.LUA_TUSERDATA) { if (LuaAPI.xlua_gettypeid(L, index) != IFrameworkLuaPedding_TypeID) { throw new Exception("invalid userdata for IFramework.Lua.Pedding"); } IntPtr buff = LuaAPI.lua_touserdata(L, index); if (!CopyByValue.UnPack(buff, 0, out val)) { throw new Exception("unpack fail for IFramework.Lua.Pedding"); } } else if (type == LuaTypes.LUA_TTABLE) { CopyByValue.UnPack(this, L, index, out val); } else { val = (IFramework.Lua.Pedding)objectCasters.GetCaster(typeof(IFramework.Lua.Pedding))(L, index, null); } }
public static bool Pack(IntPtr buff, int offset, IFramework.Lua.Pedding field) { if (!Pack(buff, offset, field.c)) { return(false); } return(true); }
public static bool UnPack(IntPtr buff, int offset, out IFramework.Lua.Pedding field) { field = default(IFramework.Lua.Pedding); if (!UnPack(buff, offset, out field.c)) { return(false); } return(true); }
public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out IFramework.Lua.Pedding val) { val = new IFramework.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); }
public void PushIFrameworkLuaPedding(RealStatePtr L, IFramework.Lua.Pedding val) { if (IFrameworkLuaPedding_TypeID == -1) { bool is_first; IFrameworkLuaPedding_TypeID = getTypeId(L, typeof(IFramework.Lua.Pedding), out is_first); } IntPtr buff = LuaAPI.xlua_pushstruct(L, 1, IFrameworkLuaPedding_TypeID); if (!CopyByValue.Pack(buff, 0, val)) { throw new Exception("pack fail fail for IFramework.Lua.Pedding ,value=" + val); } }
public void UpdateIFrameworkLuaPedding(RealStatePtr L, int index, IFramework.Lua.Pedding val) { if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA) { if (LuaAPI.xlua_gettypeid(L, index) != IFrameworkLuaPedding_TypeID) { throw new Exception("invalid userdata for IFramework.Lua.Pedding"); } IntPtr buff = LuaAPI.lua_touserdata(L, index); if (!CopyByValue.Pack(buff, 0, val)) { throw new Exception("pack fail for IFramework.Lua.Pedding ,value=" + val); } } else { throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index)); } }