Files
2025-01-25 04:38:09 +08:00

193 lines
5.9 KiB
Lua

--文件是自动生成,请勿手动修改.来自数据文件:state
local L_CompressMaxColumn = 2
local L_CompressData = {
4758802781605990501,2051000,
--101,1,1,1_15,等级提升到{0}级,,,,8,2051000,,,
4758802755689390281,2051000,
--201,2,1,1_40,等级提升到{0}级,,,,8,2051000,,,
4758802755714560301,2051000,
--301,3,1,1_70,等级提升到{0}级,,,,8,2051000,,,
4758802781610197393,2051000,
--401,4,1,1_107,等级提升到{0}级,,,,8,2051000,,,
4758802755345469941,2051000,
--501,5,1,1_150,等级提升到{0}级,,,,8,2051000,,,
147117175501775449,1212000,
--601,6,1,3_362000,战斗力达到{0},,,,,1212000,,,
4758802755784041050,2051000,
--602,6,2,1_180,等级提升到{0}级,,,,8,2051000,,,
147117175505973949,1212000,
--701,7,1,3_750000,战斗力达到{0},,,,,1212000,,,
4758802755440112318,2051000,
--702,7,2,1_220,等级提升到{0}级,,,,8,2051000,,,
147117175508075297,1212000,
--801,8,1,3_2500000,战斗力达到{0},,,,,1212000,,,
4758802781620962082,2051000,
--802,8,2,1_260,等级提升到{0}级,,,,8,2051000,,,
147117175512273797,1212000,
--901,9,1,3_4000000,战斗力达到{0},,,,,1212000,,,
4758802755723236230,2051000,
--902,9,2,1_300,等级提升到{0}级,,,,8,2051000,,,
147117175514375145,1212000,
--1001,10,1,3_6000000,战斗力达到{0},,,,,1212000,,,
4758802755643548650,2051000,
--1002,10,2,1_340,等级提升到{0}级,,,,8,2051000,,,
147117175516476493,1212000,
--1101,11,1,3_8000000,战斗力达到{0},,,,,1212000,,,
4758802756113314894,2051000,
--1102,11,2,1_370,等级提升到{0}级,,,,8,2051000,,,
147117175518577841,1212000,
--1201,12,1,3_15000000,战斗力达到{0},,,,,1212000,,,
4758802781631464626,2051000,
--1202,12,2,1_420,等级提升到{0}级,,,,8,2051000,,,
147117175522776341,1212000,
--1301,13,1,3_12120000,战斗力达到{0},,,,,1212000,,,
4758802770971645206,2051000,
--1302,13,2,1_480,等级提升到{0}级,,,,8,2051000,,,
147117175524877689,1212000,
--1401,14,1,3_32000000,战斗力达到{0},,,,,1212000,,,
4758802770977940858,2051000,
--1402,14,2,1_540,等级提升到{0}级,,,,8,2051000,,,
147117175526979037,1212000,
--1501,15,1,3_46000000,战斗力达到{0},,,,,1212000,,,
4758802770984236510,2051000,
--1502,15,2,1_600,等级提升到{0}级,,,,8,2051000,,,
147117175529080385,1212000,
--1601,16,1,3_64000000,战斗力达到{0},,,,,1212000,,,
4758802756293690946,2051000,
--1602,16,2,1_700,等级提升到{0}级,,,,8,2051000,,,
}
local L_MainKeyDic = {
[101]=1,[201]=2,[301]=3,[401]=4,[501]=5,[601]=6,[602]=7,[701]=8,[702]=9,[801]=10,[802]=11,[901]=12,[902]=13,[1001]=14,[1002]=15,
[1101]=16,[1102]=17,[1201]=18,[1202]=19,[1301]=20,[1302]=21,[1401]=22,[1402]=23,[1501]=24,[1502]=25,[1601]=26,[1602]=27,}
local L_NamesByNum = {
Id = 1,
Group = 2,
Sort = 3,
LimitType = 6,
LimitValue = 7,
ShowItem = 9,
GetText = 10,
GetDailyActive = 11,
}
local L_NamesByString = {
Condition = 4,
Des = 5,
LimitDescribe = 8,
}
local L_ColNameIndexs = {
Id = 0,
Group = 1,
Sort = 2,
Condition = 3,
Des = 4,
LimitType = 5,
LimitValue = 6,
LimitDescribe = 7,
ShowItem = 8,
GetText = 9,
GetDailyActive = 10,
}
--local L_ColumnUseBitCount = {12,6,3,16,16,2,2,2,5,22,2,}
--local L_ColumnList = {1,1,1,1,1,1,1,1,1,2,2,}
--local L_ShiftDataList = {0,12,18,21,37,53,55,57,59,0,22,}
--local L_AndDataList = {2047,31,3,32767,32767,1,1,1,15,2097151,1,}
local L_ColumnShiftAndList = {1,0,2047,1,12,31,1,18,3,1,21,32767,1,37,32767,1,53,1,1,55,1,1,57,1,1,59,15,2,0,2097151,2,22,1,}
local L_ColNum = 11;
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 = 27
}
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