--文件是自动生成,请勿手动修改.来自数据文件:pet_equip_resolve local L_CompressMaxColumn = 1 local L_CompressData = { 253191966657, --7000001,爪套-白色,10000_1098_1;100_1099_1,, 253208743874, --7000002,项圈-白色,10000_1098_1;100_1100_1,, 253225521091, --7000003,铃铛-白色,10000_1098_1;100_1101_1,, 253242298308, --7000004,福袋-白色,10000_1098_1;100_1102_1,, 253191966661, --7000005,爪套-绿色,10000_1098_1;100_1099_1,, 253208743878, --7000006,项圈-绿色,10000_1098_1;100_1100_1,, 253225521095, --7000007,铃铛-绿色,10000_1098_1;100_1101_1,, 253242298312, --7000008,福袋-绿色,10000_1098_1;100_1102_1,, 253191966665, --7000009,爪套-蓝色,10000_1098_1;100_1099_1,, 253208743882, --7000010,项圈-蓝色,10000_1098_1;100_1100_1,, 253225521099, --7000011,铃铛-蓝色,10000_1098_1;100_1101_1,, 253242298316, --7000012,福袋-蓝色,10000_1098_1;100_1102_1,, 253191966669, --7000013,爪套-紫色,10000_1098_1;100_1099_1,, 253208743886, --7000014,项圈-紫色,10000_1098_1;100_1100_1,, 253225521103, --7000015,铃铛-紫色,10000_1098_1;100_1101_1,, 253242298320, --7000016,福袋-紫色,10000_1098_1;100_1102_1,, 253191966673, --7000017,爪套-紫色1星,10000_1098_1;100_1099_1,, 253208743890, --7000018,项圈-紫色1星,10000_1098_1;100_1100_1,, 253225521107, --7000019,铃铛-紫色1星,10000_1098_1;100_1101_1,, 253242298324, --7000020,福袋-紫色1星,10000_1098_1;100_1102_1,, 253191966677, --7000021,爪套-金色1星,10000_1098_1;100_1099_1,, 253208743894, --7000022,项圈-金色1星,10000_1098_1;100_1100_1,, 253225521111, --7000023,铃铛-金色1星,10000_1098_1;100_1101_1,, 253242298328, --7000024,福袋-金色1星,10000_1098_1;100_1102_1,, 253191966681, --7000025,爪套-金色2星,10000_1098_1;100_1099_1,, 253208743898, --7000026,项圈-金色2星,10000_1098_1;100_1100_1,, 253225521115, --7000027,铃铛-金色2星,10000_1098_1;100_1101_1,, 253242298332, --7000028,福袋-金色2星,10000_1098_1;100_1102_1,, 253191966685, --7000029,爪套-金色3星,10000_1098_1;100_1099_1,, 253208743902, --7000030,项圈-金色3星,10000_1098_1;100_1100_1,, 253225521119, --7000031,铃铛-金色3星,10000_1098_1;100_1101_1,, 253242298336, --7000032,福袋-金色3星,10000_1098_1;100_1102_1,, 253191966689, --7000033,爪套-红色1星,10000_1098_1;100_1099_1,, 253208743906, --7000034,项圈-红色1星,10000_1098_1;100_1100_1,, 253225521123, --7000035,铃铛-红色1星,10000_1098_1;100_1101_1,, 253242298340, --7000036,福袋-红色1星,10000_1098_1;100_1102_1,, 253191966693, --7000037,爪套-红色2星,10000_1098_1;100_1099_1,, 253208743910, --7000038,项圈-红色2星,10000_1098_1;100_1100_1,, 253225521127, --7000039,铃铛-红色2星,10000_1098_1;100_1101_1,, 253242298344, --7000040,福袋-红色2星,10000_1098_1;100_1102_1,, 253191966697, --7000041,爪套-红色3星,10000_1098_1;100_1099_1,, 253208743914, --7000042,项圈-红色3星,10000_1098_1;100_1100_1,, 253225521131, --7000043,铃铛-红色3星,10000_1098_1;100_1101_1,, 253242298348, --7000044,福袋-红色3星,10000_1098_1;100_1102_1,, 253191966701, --7000045,爪套-红色4星,10000_1098_1;100_1099_1,, 253208743918, --7000046,项圈-红色4星,10000_1098_1;100_1100_1,, 253225521135, --7000047,铃铛-红色4星,10000_1098_1;100_1101_1,, 253242298352, --7000048,福袋-红色4星,10000_1098_1;100_1102_1,, 253191966705, --7000049,爪套-红色5星,10000_1098_1;100_1099_1,, 253208743922, --7000050,项圈-红色5星,10000_1098_1;100_1100_1,, 253225521139, --7000051,铃铛-红色5星,10000_1098_1;100_1101_1,, 253242298356, --7000052,福袋-红色5星,10000_1098_1;100_1102_1,, 253191966709, --7000053,爪套-粉色5星,10000_1098_1;100_1099_1,, 253208743926, --7000054,项圈-粉色5星,10000_1098_1;100_1100_1,, 253225521143, --7000055,铃铛-粉色5星,10000_1098_1;100_1101_1,, 253242298360, --7000056,福袋-粉色5星,10000_1098_1;100_1102_1,, 253191966713, --7000057,爪套-暗金5星,10000_1098_1;100_1099_1,, 253208743930, --7000058,项圈-暗金5星,10000_1098_1;100_1100_1,, 253225521147, --7000059,铃铛-暗金5星,10000_1098_1;100_1101_1,, 253242298364, --7000060,福袋-暗金5星,10000_1098_1;100_1102_1,, 253191966717, --7000061,爪套-幻彩5星,10000_1098_1;100_1099_1,, 253208743934, --7000062,项圈-幻彩5星,10000_1098_1;100_1100_1,, 253225521151, --7000063,铃铛-幻彩5星,10000_1098_1;100_1101_1,, 253242298368, --7000064,福袋-幻彩5星,10000_1098_1;100_1102_1,, } local L_MainKeyDic = { [7000001]=1,[7000002]=2,[7000003]=3,[7000004]=4,[7000005]=5,[7000006]=6,[7000007]=7,[7000008]=8,[7000009]=9,[7000010]=10,[7000011]=11,[7000012]=12,[7000013]=13,[7000014]=14,[7000015]=15, [7000016]=16,[7000017]=17,[7000018]=18,[7000019]=19,[7000020]=20,[7000021]=21,[7000022]=22,[7000023]=23,[7000024]=24,[7000025]=25,[7000026]=26,[7000027]=27,[7000028]=28,[7000029]=29,[7000030]=30, [7000031]=31,[7000032]=32,[7000033]=33,[7000034]=34,[7000035]=35,[7000036]=36,[7000037]=37,[7000038]=38,[7000039]=39,[7000040]=40,[7000041]=41,[7000042]=42,[7000043]=43,[7000044]=44,[7000045]=45, [7000046]=46,[7000047]=47,[7000048]=48,[7000049]=49,[7000050]=50,[7000051]=51,[7000052]=52,[7000053]=53,[7000054]=54,[7000055]=55,[7000056]=56,[7000057]=57,[7000058]=58,[7000059]=59,[7000060]=60, [7000061]=61,[7000062]=62,[7000063]=63,[7000064]=64,} local L_NamesByNum = { Id = 1, } local L_NamesByString = { ResolveRewards = 2, } local L_ColNameIndexs = { Id = 0, ResolveRewards = 1, } --local L_ColumnUseBitCount = {24,15,} --local L_ColumnList = {1,1,} --local L_ShiftDataList = {0,24,} --local L_AndDataList = {8388607,16383,} local L_ColumnShiftAndList = {1,0,8388607,1,24,16383,} local L_ColNum = 2; local L_UseDataK = setmetatable({ },{ __mode = 'k'}); local L_UseDataV = setmetatable({ },{ __mode = 'v'}); local L_UseDataRow = setmetatable({ },{ __mode = 'v'}); local L_IsCache = false; local mt = {} local function GetData(row, column) local startIndex = (column - 1) * 3 local _compressData = L_CompressData[row] local _tempData = _compressData >> L_ColumnShiftAndList[startIndex + 2] local _data = _tempData & L_ColumnShiftAndList[startIndex + 3] local _andSign = L_ColumnShiftAndList[startIndex + 3] + 1 local _isMinus = (_andSign & _tempData) == _andSign return _isMinus and -_data or _data; end mt.__index = function (t,key) local _key = L_UseDataK[t]; local _row = L_MainKeyDic[_key]; local _column = L_NamesByNum[key]; if _column ~= nil then if L_IsCache then local _data = L_UseDataRow[_row * L_ColNum + _column] if not _data then _data = GetData(_row, _column) L_UseDataRow[_row * L_ColNum + _column] = _data end return _data else return GetData(_row, _column) end end _column = L_NamesByString[key] if _column ~= nil then return StringDefines[GetData(_row, _column)] end if string.find(key, '_') then local _newKey = string.gsub(key, '_', '') _column = L_NamesByString[_newKey] if _column ~= nil then return GetData(_row, _column) end end if key ~= '_OnCopyAfter_' then return end end local M = { _CompressData_ = L_CompressData, _ColumnShiftAndList_ = L_ColumnShiftAndList, _CompressMaxColumn_ = L_CompressMaxColumn, _ColumnNameIndexs_ = L_ColNameIndexs, Count = 64 } function M:Foreach(func) for i=1,M.Count do local _key = GetData(i, 1) func(_key, M[_key]) end end function M:ForeachCanBreak(func) for i = 1,M.Count do local _key = GetData(i, 1) if func(_key, M[_key]) then break end end end function M:GetByIndex(index) return M[GetData(index, 1)]; end function M:IsContainKey(key) return not(not L_MainKeyDic[key]); end function M:SetIsCache(isCh) L_IsCache = isCh; end setmetatable(M, {__index = function(t, key) if not L_MainKeyDic[key] then return; end local _t = L_UseDataV[key]; if not _t then _t = setmetatable({}, mt); L_UseDataV[key] = _t; L_UseDataK[_t] = key; end return _t end}) return M