140 lines
3.7 KiB
Lua
140 lines
3.7 KiB
Lua
--文件是自动生成,请勿手动修改.来自数据文件:Cross_devil_hunt_Hot
|
|
local L_CompressMaxColumn = 1
|
|
local L_CompressData = {
|
|
145300187681,
|
|
--1,低概率蓝色,0_159,较小机率产出蓝色,,
|
|
145308576354,
|
|
--2,中概率蓝色,160_319,一定机率产出蓝色,,
|
|
145316965027,
|
|
--3,高概率蓝色,320_479,很大机率产出蓝色,,
|
|
145325353700,
|
|
--4,低概率紫色,480_639,较小机率产出紫色,,
|
|
145333742373,
|
|
--5,中概率紫色,640_799,一定机率产出紫色,,
|
|
145342131046,
|
|
--6,高概率紫色,800_1119,很大机率产出紫色,,
|
|
145350519719,
|
|
--7,低概率橙色,1120_1139,较小机率产出金色,,
|
|
145358908392,
|
|
--8,中概率橙色,1140_1759,一定机率产出金色,,
|
|
145367297065,
|
|
--9,高概率橙色,1760_-1,很大机率产出金色,,
|
|
}
|
|
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,
|
|
}
|
|
local L_NamesByString = {
|
|
Hot = 2,
|
|
ShowUI = 3,
|
|
}
|
|
local L_ColNameIndexs = {
|
|
Id = 0,
|
|
Hot = 1,
|
|
ShowUI = 2,
|
|
}
|
|
--local L_ColumnUseBitCount = {5,17,17,}
|
|
--local L_ColumnList = {1,1,1,}
|
|
--local L_ShiftDataList = {0,5,22,}
|
|
--local L_AndDataList = {15,65535,65535,}
|
|
local L_ColumnShiftAndList = {1,0,15,1,5,65535,1,22,65535,}
|
|
local L_ColNum = 3;
|
|
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
|