161 lines
4.4 KiB
Lua
161 lines
4.4 KiB
Lua
--文件是自动生成,请勿手动修改.来自数据文件:task_recommend_tips
|
|
local L_CompressMaxColumn = 1
|
|
local L_CompressData = {
|
|
611664577,
|
|
--1,11,[7afc23]荐[-] 挑战[7afc23]个人首领[-],,
|
|
611680578,
|
|
--2,5,[7afc23]荐[-] 挑战[7afc24]竞技场[-],,
|
|
611697027,
|
|
--3,6,[7afc23]荐[-] 挑战[7afc25]天禁之门[-],,
|
|
611713540,
|
|
--4,8,[7afc23]荐[-] 挑战[7afc26]凌云妖塔[-],,
|
|
611730501,
|
|
--5,17,[7afc23]荐[-] 参加[7afc35]仙盟任务[-],,
|
|
611746374,
|
|
--6,9,[7afc23]荐[-] 挑战[7afc27]心魔幻境[-],,
|
|
611762823,
|
|
--7,10,[7afc23]荐[-] 挑战[7afc28]锁灵台[-],,
|
|
611778824,
|
|
--8,4,[7afc23]荐[-] 挑战[7afc23]无极墟域[-],,
|
|
611796169,
|
|
--9,19,[7afc23]荐[-] 参加[7afc29]精英狩猎[-],,
|
|
611812106,
|
|
--10,12,[7afc23]荐[-] 挑战[7afc30]晶甲和域[-],,
|
|
611827915,
|
|
--11,3,[7afc23]荐[-] 参加[7afc23]赏金之道[-],,
|
|
611845004,
|
|
--12,14,[7afc23]荐[-] 挑战[7afc23]年兽封域[-],,
|
|
611861773,
|
|
--13,20,[7afc23]荐[-] 挑战[7afc31]无限首领[-],,
|
|
611883406,
|
|
--14,102,[7afc23]荐[-] 参加[7afc32]天芒鬼城[-],,
|
|
611899855,
|
|
--15,103,[7afc23]荐[-] 参加[7afc33]天道秘境[-],,
|
|
611916304,
|
|
--16,104,[7afc23]荐[-] 参加[7afc34]心境博弈[-],,
|
|
611932753,
|
|
--17,105,[7afc23]荐[-] 参加[7afc35]日暮篝火[-],,
|
|
611949522,
|
|
--18,111,[7afc23]荐[-] 挑战[7afc36]仙盟首领[-],,
|
|
611958931,
|
|
--19,2,[7afc23]经验[-] 参加[7afc23]掌门传道[-]升级,,
|
|
}
|
|
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,}
|
|
local L_NamesByNum = {
|
|
Id = 1,
|
|
DailyId = 2,
|
|
}
|
|
local L_NamesByString = {
|
|
RecommendDes = 3,
|
|
}
|
|
local L_ColNameIndexs = {
|
|
Id = 0,
|
|
DailyId = 1,
|
|
RecommendDes = 2,
|
|
}
|
|
--local L_ColumnUseBitCount = {6,8,17,}
|
|
--local L_ColumnList = {1,1,1,}
|
|
--local L_ShiftDataList = {0,6,14,}
|
|
--local L_AndDataList = {31,127,65535,}
|
|
local L_ColumnShiftAndList = {1,0,31,1,6,127,1,14,65535,}
|
|
local L_ColNum = 3;
|
|
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 = 19
|
|
}
|
|
|
|
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
|