202 lines
6.6 KiB
Lua
202 lines
6.6 KiB
Lua
--文件是自动生成,请勿手动修改.来自数据文件:Equip_Magic_resolve
|
|
local L_CompressMaxColumn = 1
|
|
local L_CompressData = {
|
|
727335868073,
|
|
--10000041,幻装头盔-0阶-粉0星-通用,1380_3;10000001_1,,
|
|
727302313642,
|
|
--10000042,幻装耳环-0阶-粉0星-通用,1380_3;10000002_1,,
|
|
727268759211,
|
|
--10000043,幻装项链-0阶-粉0星-通用,1380_3;10000003_1,,
|
|
727235204780,
|
|
--10000044,幻装衣服-0阶-粉0星-通用,1380_3;10000004_1,,
|
|
727201650349,
|
|
--10000045,幻装裤子-0阶-粉0星-通用,1380_3;10000005_1,,
|
|
727168095918,
|
|
--10000046,幻装武器-0阶-粉0星-通用,1380_3;10000006_1,,
|
|
727134541487,
|
|
--10000047,幻装护腕-0阶-粉0星-通用,1380_3;10000007_1,,
|
|
727100987056,
|
|
--10000048,幻装鞋子-0阶-粉0星-通用,1380_3;10000008_1,,
|
|
727067432625,
|
|
--10000049,幻装戒指-0阶-粉0星-通用,1407_2;10000009_1,,
|
|
727033878194,
|
|
--10000050,幻装手镯-0阶-粉0星-通用,1408_2;10000010_1,,
|
|
727000323763,
|
|
--10000051,幻装头盔-0阶-粉1星-通用,1380_3;10000011_1,,
|
|
726966769332,
|
|
--10000052,幻装耳环-0阶-粉1星-通用,1380_3;10000012_1,,
|
|
726933214901,
|
|
--10000053,幻装项链-0阶-粉1星-通用,1380_3;10000013_1,,
|
|
726899660470,
|
|
--10000054,幻装衣服-0阶-粉1星-通用,1380_3;10000014_1,,
|
|
726866106039,
|
|
--10000055,幻装裤子-0阶-粉1星-通用,1380_3;10000015_1,,
|
|
726832551608,
|
|
--10000056,幻装武器-0阶-粉1星-通用,1380_3;10000016_1,,
|
|
726798997177,
|
|
--10000057,幻装护腕-0阶-粉1星-通用,1380_3;10000017_1,,
|
|
726765442746,
|
|
--10000058,幻装鞋子-0阶-粉1星-通用,1380_3;10000018_1,,
|
|
726731888315,
|
|
--10000059,幻装戒指-0阶-粉1星-通用,1407_2;10000019_1,,
|
|
726698333884,
|
|
--10000060,幻装手镯-0阶-粉1星-通用,1408_2;10000020_1,,
|
|
726664779453,
|
|
--10000061,幻装头盔-0阶-粉2星-通用,1380_3;10000021_1,,
|
|
726631225022,
|
|
--10000062,幻装耳环-0阶-粉2星-通用,1380_3;10000022_1,,
|
|
726597670591,
|
|
--10000063,幻装项链-0阶-粉2星-通用,1380_3;10000023_1,,
|
|
726564116160,
|
|
--10000064,幻装衣服-0阶-粉2星-通用,1380_3;10000024_1,,
|
|
726530561729,
|
|
--10000065,幻装裤子-0阶-粉2星-通用,1380_3;10000025_1,,
|
|
726497007298,
|
|
--10000066,幻装武器-0阶-粉2星-通用,1380_3;10000026_1,,
|
|
726463452867,
|
|
--10000067,幻装护腕-0阶-粉2星-通用,1380_3;10000027_1,,
|
|
726429898436,
|
|
--10000068,幻装鞋子-0阶-粉2星-通用,1380_3;10000028_1,,
|
|
726396344005,
|
|
--10000069,幻装戒指-0阶-粉2星-通用,1407_2;10000029_1,,
|
|
726362789574,
|
|
--10000070,幻装手镯-0阶-粉2星-通用,1408_2;10000030_1,,
|
|
726329235143,
|
|
--10000071,幻装头盔-0阶-粉3星-通用,1380_3;10000031_1,,
|
|
726295680712,
|
|
--10000072,幻装耳环-0阶-粉3星-通用,1380_3;10000032_1,,
|
|
726262126281,
|
|
--10000073,幻装项链-0阶-粉3星-通用,1380_3;10000033_1,,
|
|
726228571850,
|
|
--10000074,幻装衣服-0阶-粉3星-通用,1380_3;10000034_1,,
|
|
726195017419,
|
|
--10000075,幻装裤子-0阶-粉3星-通用,1380_3;10000035_1,,
|
|
726161462988,
|
|
--10000076,幻装武器-0阶-粉3星-通用,1380_3;10000036_1,,
|
|
726127908557,
|
|
--10000077,幻装护腕-0阶-粉3星-通用,1380_3;10000037_1,,
|
|
726094354126,
|
|
--10000078,幻装鞋子-0阶-粉3星-通用,1380_3;10000038_1,,
|
|
726060799695,
|
|
--10000079,幻装戒指-0阶-粉3星-通用,1407_2;10000039_1,,
|
|
726027245264,
|
|
--10000080,幻装手镯-0阶-粉3星-通用,1408_2;10000040_1,,
|
|
}
|
|
local L_MainKeyDic = {
|
|
[10000041]=1,[10000042]=2,[10000043]=3,[10000044]=4,[10000045]=5,[10000046]=6,[10000047]=7,[10000048]=8,[10000049]=9,[10000050]=10,[10000051]=11,[10000052]=12,[10000053]=13,[10000054]=14,[10000055]=15,
|
|
[10000056]=16,[10000057]=17,[10000058]=18,[10000059]=19,[10000060]=20,[10000061]=21,[10000062]=22,[10000063]=23,[10000064]=24,[10000065]=25,[10000066]=26,[10000067]=27,[10000068]=28,[10000069]=29,[10000070]=30,
|
|
[10000071]=31,[10000072]=32,[10000073]=33,[10000074]=34,[10000075]=35,[10000076]=36,[10000077]=37,[10000078]=38,[10000079]=39,[10000080]=40,}
|
|
local L_NamesByNum = {
|
|
Id = 1,
|
|
}
|
|
local L_NamesByString = {
|
|
ResolveItem = 2,
|
|
}
|
|
local L_ColNameIndexs = {
|
|
Id = 0,
|
|
ResolveItem = 1,
|
|
}
|
|
--local L_ColumnUseBitCount = {25,16,}
|
|
--local L_ColumnList = {1,1,}
|
|
--local L_ShiftDataList = {0,25,}
|
|
--local L_AndDataList = {16777215,32767,}
|
|
local L_ColumnShiftAndList = {1,0,16777215,1,25,32767,}
|
|
local L_ColNum = 2;
|
|
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 = 40
|
|
}
|
|
|
|
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
|