155 lines
4.3 KiB
Lua
155 lines
4.3 KiB
Lua
--文件是自动生成,请勿手动修改.来自数据文件:marry_wall
|
||
local L_CompressMaxColumn = 1
|
||
local L_CompressData = {
|
||
45162168385,
|
||
--1,,仙途独行路迢迢,寻一仙侣共逍遥,,
|
||
45164265538,
|
||
--2,,寻一良缘,宠TA爱TA一辈子,,
|
||
45166362691,
|
||
--3,,愿得一人心,白首不分离,,
|
||
45168459844,
|
||
--4,,寻一仙缘,我超萌!(*^△^*),,
|
||
45170556997,
|
||
--5,,寻一仙缘,我超有型!(*^△^*),,
|
||
45173410822,
|
||
--6,1_50,寻一段良缘,结婚费用我全包,仙甲法宝为你打造!,,
|
||
45175507975,
|
||
--7,1_50,寻一佳偶,一齐冲榜拿完美情缘奖励,,
|
||
45177605128,
|
||
--8,1_50,寻仙缘,三生三世十里桃花,做你完美情缘!,,
|
||
45179702281,
|
||
--9,1_50,寻找一个仙缘共赴仙途,今生今世宠你一人!,,
|
||
45181799434,
|
||
--10,1_50,看了黄历,今日宜婚,万事俱备只差你!,,
|
||
45183896587,
|
||
--11,1_50,过年不想收红包,只想收一个仙缘小宝宝!,,
|
||
45185993740,
|
||
--12,1_50,良辰美景,求一仙缘,白首相随,不离不弃,,
|
||
45188090893,
|
||
--13,1_50,漫漫仙路,求一仙缘,结发为夫妻,恩爱永不弃,,
|
||
45190188046,
|
||
--14,1_50,仙路迢迢,求一仙缘,愿我如星如月,夜夜流光相皎洁,,
|
||
45192285199,
|
||
--15,1_50,求一仙缘,相伴此生,夜月一帘幽梦,春风十里柔情,,
|
||
45194382352,
|
||
--16,1_50,求一仙缘,相伴此生,只愿君心似我心,定不负相思意,,
|
||
}
|
||
local L_MainKeyDic = {
|
||
[1]=1,[2]=2,[3]=3,[4]=4,[5]=5,[6]=6,[7]=7,[8]=8,[9]=9,[10]=10,[11]=11,[12]=12,[13]=13,[14]=14,[15]=15,
|
||
[16]=16,}
|
||
local L_NamesByNum = {
|
||
Id = 1,
|
||
}
|
||
local L_NamesByString = {
|
||
CostItem = 2,
|
||
Desc = 3,
|
||
}
|
||
local L_ColNameIndexs = {
|
||
Id = 0,
|
||
CostItem = 1,
|
||
Desc = 2,
|
||
}
|
||
--local L_ColumnUseBitCount = {6,15,16,}
|
||
--local L_ColumnList = {1,1,1,}
|
||
--local L_ShiftDataList = {0,6,21,}
|
||
--local L_AndDataList = {31,16383,32767,}
|
||
local L_ColumnShiftAndList = {1,0,31,1,6,16383,1,21,32767,}
|
||
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 = 16
|
||
}
|
||
|
||
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
|