Files
Main/Assets/GameAssets/Resources/Lua/Config/Data/DataCrossDevilCardSynthesis.lua
2025-01-25 04:38:09 +08:00

181 lines
4.9 KiB
Lua

--文件是自动生成,请勿手动修改.来自数据文件:Cross_devil_card_Synthesis
local L_CompressMaxColumn = 1
local L_CompressData = {
91994072043,
--1003,1,3,9000005_9000006_9000007_9000008,,
91998275539,
--2003,2,3,9000033_9000034_9000035_9000036,,
92002479035,
--3003,3,3,9000061_9000062_9000063_9000064,,
92006682531,
--4003,4,3,9000089_9000090_9000091_9000092,,
92010980332,
--1004,1,4,9000009_9000010_9000011_9000012,,
92015183828,
--2004,2,4,9000037_9000038_9000039_9000040,,
92019387324,
--3004,3,4,9000065_9000066_9000067_9000068,,
92023590820,
--4004,4,4,9000093_9000094_9000095_9000096,,
92028019694,
--1006,1,6,9000013_9000014_9000015_9000016,,
92032223190,
--2006,2,6,9000041_9000042_9000043_9000044,,
92036426686,
--3006,3,6,9000069_9000070_9000071_9000072,,
92040630182,
--4006,4,6,9000097_9000098_9000099_9000100,,
92044927983,
--1007,1,7,9000017_9000018_9000019_9000020,,
92049131479,
--2007,2,7,9000045_9000046_9000047_9000048,,
92053334975,
--3007,3,7,9000073_9000074_9000075_9000076,,
92057538471,
--4007,4,7,9000101_9000102_9000103_9000104,,
92061836272,
--1008,1,8,9000021_9000022_9000023_9000024,,
92066039768,
--2008,2,8,9000049_9000050_9000051_9000052,,
92070243264,
--3008,3,8,9000077_9000078_9000079_9000080,,
92074446760,
--4008,4,8,9000105_9000106_9000107_9000108,,
92078744561,
--1009,1,9,9000025_9000026_9000027_9000028,,
92082948057,
--2009,2,9,9000053_9000054_9000055_9000056,,
92087151553,
--3009,3,9,9000081_9000082_9000083_9000084,,
92091355049,
--4009,4,9,9000109_9000110_9000111_9000112,,
92095652850,
--1010,1,10,9000029_9000030_9000031_9000032,,
92099856346,
--2010,2,10,9000057_9000058_9000059_9000060,,
92104059842,
--3010,3,10,9000085_9000086_9000087_9000088,,
92108263338,
--4010,4,10,9000113_9000114_9000115_9000116,,
}
local L_MainKeyDic = {
[1003]=1,[2003]=2,[3003]=3,[4003]=4,[1004]=5,[2004]=6,[3004]=7,[4004]=8,[1006]=9,[2006]=10,[3006]=11,[4006]=12,[1007]=13,[2007]=14,[3007]=15,
[4007]=16,[1008]=17,[2008]=18,[3008]=19,[4008]=20,[1009]=21,[2009]=22,[3009]=23,[4009]=24,[1010]=25,[2010]=26,[3010]=27,[4010]=28,}
local L_NamesByNum = {
Id = 1,
Camp = 2,
Quality = 3,
}
local L_NamesByString = {
Equip = 4,
}
local L_ColNameIndexs = {
Id = 0,
Camp = 1,
Quality = 2,
Equip = 3,
}
--local L_ColumnUseBitCount = {13,4,5,16,}
--local L_ColumnList = {1,1,1,1,}
--local L_ShiftDataList = {0,13,17,22,}
--local L_AndDataList = {4095,7,15,32767,}
local L_ColumnShiftAndList = {1,0,4095,1,13,7,1,17,15,1,22,32767,}
local L_ColNum = 4;
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 = 28
}
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