--文件是自动生成,请勿手动修改.来自数据文件:recharge_daily_cangzhenge local L_CompressMaxColumn = 1 local L_CompressData = { 18934408961381, --101,1,1069_10_1_9,10000,0,1,0,, 88855638802790, --102,1,16196_1_1_9,6666,0,1,1,, 92359128172903, --103,1,17011_1_1_9,1,1,1,1,, 92359128170856, --104,1,15014_1_1_9,1,1,1,1,, 92359148967273, --105,1,19007_1_1_9,1,1,1,1,, 87961077645674, --106,1,16196_1_1_9,1,0,1,1,, 18934408962411, --107,1,1069_15_1_9,10000,0,1,0,, 88855638820204, --108,1,16197_1_1_9,6666,0,1,1,, 18934408963437, --109,1,1069_20_1_9,10000,0,1,0,, 88855638828398, --110,1,16198_1_1_9,6666,0,1,1,, 89303153142127, --111,1,1069_25_1_9,10000,0,1,1,, 88855638837616, --112,1,16199_1_1_9,6666,0,1,1,, 89303153143153, --113,1,1069_30_1_9,10000,0,1,1,, 88855671239026, --114,1,16200_1_1_9,6666,0,1,1,, 89303153145203, --115,1,1069_50_1_9,10000,0,1,1,, 18486927063412, --116,1,18001_10_1_9,6666,0,1,0,, } local L_MainKeyDic = { [101]=1,[102]=2,[103]=3,[104]=4,[105]=5,[106]=6,[107]=7,[108]=8,[109]=9,[110]=10,[111]=11,[112]=12,[113]=13,[114]=14,[115]=15, [116]=16,} local L_NamesByNum = { ID = 1, Times = 2, Probability = 4, Superreward = 5, End = 6, Record = 7, } local L_NamesByString = { Reward = 3, } local L_ColNameIndexs = { ID = 0, Times = 1, Reward = 2, Probability = 3, Superreward = 4, End = 5, Record = 6, } --local L_ColumnUseBitCount = {8,2,17,15,2,2,2,} --local L_ColumnList = {1,1,1,1,1,1,1,} --local L_ShiftDataList = {0,8,10,27,42,44,46,} --local L_AndDataList = {127,1,65535,16383,1,1,1,} local L_ColumnShiftAndList = {1,0,127,1,8,1,1,10,65535,1,27,16383,1,42,1,1,44,1,1,46,1,} local L_ColNum = 7; 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