146 lines
4.2 KiB
Lua
146 lines
4.2 KiB
Lua
--文件是自动生成,请勿手动修改.来自数据文件:state_stifle_add_level_all
|
|
local L_CompressMaxColumn = 1
|
|
local L_CompressData = {
|
|
171503763050593,
|
|
--1,3,1_1217;2_32605;3_608;4_608,,,攻击+1217生命+32605#n破甲+608防御+608,,
|
|
171512352989346,
|
|
--2,5,1_1825;2_48908;3_912;4_912,,,攻击+1825生命+48908#n破甲+912防御+912,,
|
|
171520942928099,
|
|
--3,7,1_2738;2_73362;3_1369;4_1369,,,攻击+2738生命+73362#n破甲+1369防御+1369,,
|
|
171529532866820,
|
|
--4,8,1_4107;2_110043;3_2053;4_2053,,,攻击+4107生命+110043#n破甲+2053防御+2053,,
|
|
171542417774885,
|
|
--5,9,1_6161;2_165065;3_3080;4_3080,,,攻击+6161生命+165065#n破甲+3080防御+3080,,
|
|
171555302680966,
|
|
--6,12,1_9242;2_247598;3_4621;4_4621,,,攻击+9242生命+247598#n破甲+4621防御+4621,,
|
|
171563892621799,
|
|
--7,15,1_13863;2_371397;3_6931;4_6931,,,攻击+13863生命+371397#n破甲+6931防御+6931,,
|
|
171572482560648,
|
|
--8,20,1_20794;2_557096;3_10397;4_10397,,,攻击+20794生命+557096#n破甲+10397防御+10397,,
|
|
171581072499561,
|
|
--9,27,1_31192;2_835644;3_15596;4_15596,,,攻击+31192生命+835644#n破甲+15596防御+15596,,
|
|
}
|
|
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,
|
|
LevelAll = 2,
|
|
}
|
|
local L_NamesByString = {
|
|
Attribute = 3,
|
|
PerAttribute = 4,
|
|
Skill = 5,
|
|
MaxTimes = 6,
|
|
}
|
|
local L_ColNameIndexs = {
|
|
Id = 0,
|
|
LevelAll = 1,
|
|
Attribute = 2,
|
|
PerAttribute = 3,
|
|
Skill = 4,
|
|
MaxTimes = 5,
|
|
}
|
|
--local L_ColumnUseBitCount = {5,6,17,2,2,17,}
|
|
--local L_ColumnList = {1,1,1,1,1,1,}
|
|
--local L_ShiftDataList = {0,5,11,28,30,32,}
|
|
--local L_AndDataList = {15,31,65535,1,1,65535,}
|
|
local L_ColumnShiftAndList = {1,0,15,1,5,31,1,11,65535,1,28,1,1,30,1,1,32,65535,}
|
|
local L_ColNum = 6;
|
|
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 = 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
|