233 lines
7.6 KiB
Lua
233 lines
7.6 KiB
Lua
--文件是自动生成,请勿手动修改.来自数据文件:RankAwardItem
|
|
local L_CompressMaxColumn = 2
|
|
local L_CompressData = {
|
|
1677722681601,62678,
|
|
--1,1,0,1,1,25000,,71016_1_1_9;19007_1_1_9;60003_200_1_9;81012_20_1_0;81013_20_1_1;81012_20_1_2,,
|
|
1543509180674,16431,
|
|
--2,1,0,2,5,23000,,19007_1_1_9;60003_180_1_9;81012_15_1_0;81013_15_1_1;81012_15_1_2,,
|
|
1476405690627,16432,
|
|
--3,1,0,6,10,22000,,19007_1_1_9;60003_100_1_9;81012_10_1_0;81013_10_1_1;81012_10_1_2,,
|
|
1409307476228,16433,
|
|
--4,1,0,11,20,21000,,60003_80_1_9;81012_5_1_0;81013_5_1_1;12_10000_1_9;81012_5_1_2,,
|
|
880951479509253,16434,
|
|
--5,1,1,,,20000,50,60003_60_1_9;20005_1_1_9;21005_1_1_9,,
|
|
880615935189254,16435,
|
|
--6,1,1,,,15000,50,60003_50_1_9;20004_1_1_9;21004_1_1_9,,
|
|
880280390869255,16436,
|
|
--7,1,1,,,10000,50,60003_40_1_9;20003_1_1_9;21003_1_1_9,,
|
|
3019899961864,62679,
|
|
--8,2,0,1,1,45000,,71017_1_1_9;19007_1_1_9;14003_20_1_9;14007_20_1_9,,
|
|
2952795324937,16438,
|
|
--9,2,0,2,5,44000,,19007_1_1_9;14003_10_1_9;14007_15_1_9,,
|
|
2885691834890,16439,
|
|
--10,2,0,6,10,43000,,19007_1_1_9;14002_10_1_9;14007_10_1_9,,
|
|
2818593620491,16440,
|
|
--11,2,0,11,20,42000,,14002_10_1_9;14007_10_1_9;12_10000_1_9,,
|
|
882293656789516,16441,
|
|
--12,2,1,,,40000,50,14004_10_1_9;14005_10_1_9;14001_10_1_9,,
|
|
881823894741517,16442,
|
|
--13,2,1,,,33000,50,14004_8_1_9;14005_8_1_9;14001_8_1_9,,
|
|
881488350421518,16443,
|
|
--14,2,1,,,28000,50,14004_5_1_9;14005_5_1_9;14001_5_1_9,,
|
|
3019899962127,62680,
|
|
--15,3,0,1,1,45000,,71018_1_1_9;19007_1_1_9;11003_20_1_9;81004_20_1_9,,
|
|
2952795325200,16445,
|
|
--16,3,0,2,5,44000,,19007_1_1_9;11003_10_1_9;81004_15_1_9,,
|
|
2885691835153,16446,
|
|
--17,3,0,6,10,43000,,19007_1_1_9;11002_10_1_9;81004_10_1_9,,
|
|
2818593620754,16447,
|
|
--18,3,0,11,20,42000,,11002_10_1_9;81004_10_1_9;12_10000_1_9,,
|
|
882293656789779,16448,
|
|
--19,3,1,,,40000,50,81004_20_1_9;11001_10_1_9,,
|
|
881823894741780,16449,
|
|
--20,3,1,,,33000,50,81004_16_1_9;11001_8_1_9,,
|
|
881488350421781,16450,
|
|
--21,3,1,,,28000,50,81004_10_1_9;11001_5_1_9,,
|
|
6710887482653,62681,
|
|
--29,5,0,1,1,100000,,71019_1_1_9;19007_1_1_9;83088_20_1_9;83091_1_1_9;83092_1_1_9,,
|
|
6039803069726,16452,
|
|
--30,5,0,2,5,90000,,19007_1_1_9;83088_15_1_9;83089_20_1_9,,
|
|
5368719803679,16453,
|
|
--31,5,0,6,10,80000,,19007_1_1_9;83087_15_1_9;83089_15_1_9,,
|
|
4697641813280,16454,
|
|
--32,5,0,11,20,70000,,83086_15_1_9;83089_10_1_9;12_10000_1_9,,
|
|
883635834070305,16455,
|
|
--33,5,1,,,60000,50,83086_5_1_9,,
|
|
882293656790306,16456,
|
|
--34,5,1,,,40000,50,83086_3_1_9,,
|
|
881622568150307,16457,
|
|
--35,5,1,,,30000,50,83086_2_1_9,,
|
|
4026532923442,62682,
|
|
--50,8,0,1,1,60000,,71020_1_1_9;19007_1_1_9;82396_5_1_9;82397_5_1_9;1320_10_1_9,,
|
|
3690992830515,16459,
|
|
--51,8,0,2,5,55000,,19007_1_1_9;82396_3_1_9;82398_4_1_9,,
|
|
3355453884468,16460,
|
|
--52,8,0,6,10,50000,,19007_1_1_9;82396_2_1_9;82398_3_1_9,,
|
|
3019920214069,16461,
|
|
--53,8,0,11,20,45000,,82396_1_1_9;82399_2_1_9;12_10000_1_9,,
|
|
882293656791094,16462,
|
|
--54,8,1,,,40000,50,1345_2_1_9;1317_2_1_9,,
|
|
880817261783095,16462,
|
|
--55,8,1,,,18000,50,1345_2_1_9;1317_2_1_9,,
|
|
880280390871096,16462,
|
|
--56,8,1,,,10000,50,1345_2_1_9;1317_2_1_9,,
|
|
6710887483968,62683,
|
|
--64,10,0,1,1,100000,,71021_1_1_9;19007_1_1_9;1314_1_1_9;1311_1_1_9,,
|
|
6039803071041,16464,
|
|
--65,10,0,2,5,90000,,19007_1_1_9;1314_1_1_9;1311_1_1_9,,
|
|
5368719804994,16465,
|
|
--66,10,0,6,10,80000,,19007_1_1_9;1311_1_1_9,,
|
|
4697641814595,16466,
|
|
--67,10,0,11,20,70000,,1315_2_1_9;19007_1_1_9;12_10000_1_9,,
|
|
883635834071620,16467,
|
|
--68,10,1,,,60000,50,1315_1_1_9;1306_10_1_9;1307_5_1_9;1308_5_1_9,,
|
|
881958112471621,16468,
|
|
--69,10,1,,,35000,50,1315_1_1_9;1306_10_1_9;1309_5_1_9,,
|
|
881287023831622,16469,
|
|
--70,10,1,,,25000,50,1315_1_1_9;1306_10_1_9;1310_5_1_9,,
|
|
1999845231431,62684,
|
|
--71,11,0,1,1,29800,,71022_1_1_9;19007_1_1_9;3008501_1_1_9;60016_1_1_9,,
|
|
1328760818504,16471,
|
|
--72,11,0,2,5,19800,,19007_1_1_9;3008501_1_1_9,,
|
|
1127439600457,16472,
|
|
--73,11,0,6,10,16800,,19007_1_1_9;3007505_1_1_9,,
|
|
657688202058,16473,
|
|
--74,11,0,11,20,9800,,3007505_1_1_9;12_10000_1_9,,
|
|
880266969099083,16474,
|
|
--75,11,1,,,9800,50,1012_1_1_9;3099983_20_1_9,,
|
|
880065642507084,16475,
|
|
--76,11,1,,,6800,50,1012_1_1_9;3099984_10_1_9,,
|
|
879810628823885,16475,
|
|
--77,11,1,,,3000,50,1012_1_1_9;3099984_10_1_9,,
|
|
}
|
|
local L_MainKeyDic = {
|
|
[1]=1,[2]=2,[3]=3,[4]=4,[5]=5,[6]=6,[7]=7,[8]=8,[9]=9,[10]=10,[11]=11,[12]=12,[13]=13,[14]=14,[15]=15,
|
|
[16]=16,[17]=17,[18]=18,[19]=19,[20]=20,[21]=21,[29]=22,[30]=23,[31]=24,[32]=25,[33]=26,[34]=27,[35]=28,[50]=29,[51]=30,
|
|
[52]=31,[53]=32,[54]=33,[55]=34,[56]=35,[64]=36,[65]=37,[66]=38,[67]=39,[68]=40,[69]=41,[70]=42,[71]=43,[72]=44,[73]=45,
|
|
[74]=46,[75]=47,[76]=48,[77]=49,}
|
|
local L_NamesByNum = {
|
|
Id = 1,
|
|
OwnerId = 2,
|
|
AwardType = 3,
|
|
TopRank = 4,
|
|
BottomRank = 5,
|
|
NeedValue = 6,
|
|
MaxGetCount = 7,
|
|
}
|
|
local L_NamesByString = {
|
|
AwardItems = 8,
|
|
}
|
|
local L_ColNameIndexs = {
|
|
Id = 0,
|
|
OwnerId = 1,
|
|
AwardType = 2,
|
|
TopRank = 3,
|
|
BottomRank = 4,
|
|
NeedValue = 5,
|
|
MaxGetCount = 6,
|
|
AwardItems = 7,
|
|
}
|
|
--local L_ColumnUseBitCount = {8,5,2,5,6,18,7,17,}
|
|
--local L_ColumnList = {1,1,1,1,1,1,1,2,}
|
|
--local L_ShiftDataList = {0,8,13,15,20,26,44,0,}
|
|
--local L_AndDataList = {127,15,1,15,31,131071,63,65535,}
|
|
local L_ColumnShiftAndList = {1,0,127,1,8,15,1,13,1,1,15,15,1,20,31,1,26,131071,1,44,63,2,0,65535,}
|
|
local L_ColNum = 8;
|
|
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 - 1)*L_CompressMaxColumn+L_ColumnShiftAndList[startIndex + 1]]
|
|
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 = 49
|
|
}
|
|
|
|
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
|