150 lines
5.1 KiB
Lua
150 lines
5.1 KiB
Lua
--文件是自动生成,请勿手动修改.来自数据文件:marry_activity_rank
|
|
local L_CompressMaxColumn = 2
|
|
local L_CompressData = {
|
|
338626951189279329,38498,
|
|
--1,403,1,1,2,7000,16009_1_1_9;1358_1_1_0;1359_1_1_1;1358_1_1_2;1359_1_1_3;1361_1_1_9;10003_10_1_9;16003_10_1_9;16101_10_1_9;1052_10_1_9,[010101]亲密度排名[-][158720]第{0}名[-][010101]且好友最高亲密度达到[-][158720]{1}[-],,
|
|
338644006571782754,38498,
|
|
--2,403,1,3,10,6000,1358_1_1_0;1359_1_1_1;1358_1_1_2;1359_1_1_3;1361_1_1_9;10002_10_1_9;16002_10_1_9;16101_10_1_9;1052_10_1_9,[010101]亲密度排名[-][158720]第{0}名[-][010101]且好友最高亲密度达到[-][158720]{1}[-],,
|
|
338652265878827619,38498,
|
|
--3,403,1,11,20,5000,1361_1_1_9;10002_8_1_9;16002_8_1_9;16101_10_1_9;1052_10_1_9,[010101]亲密度排名[-][158720]第{0}名[-][010101]且好友最高亲密度达到[-][158720]{1}[-],,
|
|
338660525186134628,38498,
|
|
--4,403,1,21,30,4000,1361_1_1_9;10001_10_1_9;16001_10_1_9;16101_10_1_9;1052_10_1_9,[010101]亲密度排名[-][158720]第{0}名[-][010101]且好友最高亲密度达到[-][158720]{1}[-],,
|
|
338668969118544485,38503,
|
|
--5,403,0,-1,-1,3344,1360_1_1_9;50001_10_1_9;16101_10_1_9;1052_10_1_9;81005_2_1_9;81003_2_1_9,[010101]好友最高亲密度达到[-][158720]{0}[-],,
|
|
338685964841005670,38503,
|
|
--6,403,0,-1,-1,2233,50001_8_1_9;16101_8_1_9;1052_8_1_9;81005_2_1_9;81003_2_1_9,[010101]好友最高亲密度达到[-][158720]{0}[-],,
|
|
338694267549659751,38503,
|
|
--7,403,0,-1,-1,1314,50001_6_1_9;16101_6_1_9;1052_6_1_9;81005_1_1_9;81003_1_1_9,[010101]好友最高亲密度达到[-][158720]{0}[-],,
|
|
338702889696506472,38503,
|
|
--8,403,0,-1,-1,990,50001_4_1_9;16101_4_1_9;1052_4_1_9;81005_1_1_9;81003_1_1_9,[010101]好友最高亲密度达到[-][158720]{0}[-],,
|
|
338711433460200041,38503,
|
|
--9,403,0,-1,-1,520,50001_2_1_9;16101_2_1_9;1052_2_1_9,[010101]好友最高亲密度达到[-][158720]{0}[-],,
|
|
}
|
|
local L_MainKeyDic = {
|
|
[1]=1,[2]=2,[3]=3,[4]=4,[5]=5,[6]=6,[7]=7,[8]=8,[9]=9,}
|
|
local L_NamesByNum = {
|
|
Id = 1,
|
|
RankType = 2,
|
|
RewardType = 3,
|
|
MinRank = 4,
|
|
MaxRank = 5,
|
|
Limit = 6,
|
|
}
|
|
local L_NamesByString = {
|
|
Reward = 7,
|
|
Showstring = 8,
|
|
}
|
|
local L_ColNameIndexs = {
|
|
Id = 0,
|
|
RankType = 1,
|
|
RewardType = 2,
|
|
MinRank = 3,
|
|
MaxRank = 4,
|
|
Limit = 5,
|
|
Reward = 6,
|
|
Showstring = 7,
|
|
}
|
|
--local L_ColumnUseBitCount = {5,10,2,6,6,14,17,17,}
|
|
--local L_ColumnList = {1,1,1,1,1,1,1,2,}
|
|
--local L_ShiftDataList = {0,5,15,17,23,29,43,0,}
|
|
--local L_AndDataList = {15,511,1,31,31,8191,65535,65535,}
|
|
local L_ColumnShiftAndList = {1,0,15,1,5,511,1,15,1,1,17,31,1,23,31,1,29,8191,1,43,65535,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 = 9
|
|
}
|
|
|
|
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
|