160 lines
4.8 KiB
Lua
160 lines
4.8 KiB
Lua
--文件是自动生成,请勿手动修改.来自数据文件:Cross_Alien_Connect
|
|
local L_CompressMaxColumn = 2
|
|
local L_CompressData = {
|
|
2377768360411630569,222999222089702,
|
|
--1001,1,809_810,9_10,人界虚空1,2022,1711,101_201,101,,
|
|
2378249395675089898,222999205312486,
|
|
--1002,1,810_811,10_11,人界虚空2,2022,1711,102_202,101,,
|
|
2378472048927230955,222999188535270,
|
|
--1003,1,811_812,11_12,人界虚空3,2022,1711,103_203,101,,
|
|
2378790220104551404,223152549066726,
|
|
--1004,1,812_813,12_13,人界虚空4,2022,1711,104_204,101,,
|
|
2379073905915710445,223152532289510,
|
|
--1005,1,813_814,13_14,人界虚空5,2022,1711,105_205,101,,
|
|
2379375294508321774,222944679360486,
|
|
--1006,1,814_815,14_15,人界虚空6,2022,1711,106_206,101,,
|
|
2379636858016680943,222756673877990,
|
|
--1007,1,815_816,15_16,人界虚空7,2022,1711,107_207,101,,
|
|
2379938243388066800,222374673446886,
|
|
--1008,1,816_809,16_9,人界虚空8,2022,1711,108_208,101,,
|
|
2380199810117653489,224573679929319,
|
|
--1009,2,817_818,17_18,仙界虚空1,2023,1712,109_209,102,,
|
|
2380501192267813874,224573663152103,
|
|
--1010,2,818_819,18_19,仙界虚空2,2023,1712,110_210,102,,
|
|
2380762761144882163,224573646374887,
|
|
--1011,2,819_820,19_20,仙界虚空3,2023,1712,111_211,102,,
|
|
2381054225141814260,224573596043239,
|
|
--1012,2,820_817,20_17,仙界虚空4,2023,1712,112_212,102,,
|
|
1249762150067854325,226706785507304,
|
|
--1013,3,821,21,神界虚空,2024,1713,113_213,103,,
|
|
}
|
|
local L_MainKeyDic = {
|
|
[1001]=1,[1002]=2,[1003]=3,[1004]=4,[1005]=5,[1006]=6,[1007]=7,[1008]=8,[1009]=9,[1010]=10,[1011]=11,[1012]=12,[1013]=13,}
|
|
local L_NamesByNum = {
|
|
Id = 1,
|
|
Type = 2,
|
|
CopyId = 6,
|
|
ShowIcon = 7,
|
|
GemCopy = 9,
|
|
}
|
|
local L_NamesByString = {
|
|
ConnectCity = 3,
|
|
ConnectLine = 4,
|
|
CopyName = 5,
|
|
ShowReward = 8,
|
|
}
|
|
local L_ColNameIndexs = {
|
|
Id = 0,
|
|
Type = 1,
|
|
ConnectCity = 2,
|
|
ConnectLine = 3,
|
|
CopyName = 4,
|
|
CopyId = 5,
|
|
ShowIcon = 6,
|
|
ShowReward = 7,
|
|
GemCopy = 8,
|
|
}
|
|
--local L_ColumnUseBitCount = {11,3,16,17,16,12,12,17,8,}
|
|
--local L_ColumnList = {1,1,1,1,1,2,2,2,2,}
|
|
--local L_ShiftDataList = {0,11,14,30,47,0,12,24,41,}
|
|
--local L_AndDataList = {1023,3,32767,65535,32767,2047,2047,65535,127,}
|
|
local L_ColumnShiftAndList = {1,0,1023,1,11,3,1,14,32767,1,30,65535,1,47,32767,2,0,2047,2,12,2047,2,24,65535,2,41,127,}
|
|
local L_ColNum = 9;
|
|
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 = 13
|
|
}
|
|
|
|
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
|