277 lines
6.6 KiB
Lua
277 lines
6.6 KiB
Lua
--文件是自动生成,请勿手动修改.来自数据文件:weapon_scale
|
|
local L_CompressMaxColumn = 1
|
|
local L_CompressData = {
|
|
1893818342116,
|
|
--6200036,120,110,,
|
|
1893818342117,
|
|
--6200037,120,110,,
|
|
1893818662094,
|
|
--6520014,120,110,,
|
|
1893821245081,
|
|
--9103001,120,110,,
|
|
1893821245082,
|
|
--9103002,120,110,,
|
|
1893821245083,
|
|
--9103003,120,110,,
|
|
1893821245084,
|
|
--9103004,120,110,,
|
|
2065955481245,
|
|
--9103005,130,120,,
|
|
2065955481246,
|
|
--9103006,130,120,,
|
|
2065955481247,
|
|
--9103007,130,120,,
|
|
2065955481248,
|
|
--9103008,130,120,,
|
|
2065955481249,
|
|
--9103009,130,120,,
|
|
2065955481250,
|
|
--9103010,130,120,,
|
|
2065955481251,
|
|
--9103011,130,120,,
|
|
2065955481252,
|
|
--9103012,130,120,,
|
|
2065955481253,
|
|
--9103013,130,120,,
|
|
2065955481254,
|
|
--9103014,130,120,,
|
|
2065955481255,
|
|
--9103015,130,120,,
|
|
2237754173096,
|
|
--9103016,130,130,,
|
|
2237754173097,
|
|
--9103017,130,130,,
|
|
2237754173098,
|
|
--9103018,130,130,,
|
|
2237754173099,
|
|
--9103019,130,130,,
|
|
2237754173100,
|
|
--9103020,130,130,,
|
|
2237754173101,
|
|
--9103021,130,130,,
|
|
2237754173102,
|
|
--9103022,130,130,,
|
|
2065619936943,
|
|
--9103023,120,120,,
|
|
2237754173104,
|
|
--9103024,130,130,,
|
|
1721351464701,
|
|
--9103101,100,100,,
|
|
1721351464702,
|
|
--9103102,100,100,,
|
|
1721351464703,
|
|
--9103103,100,100,,
|
|
1721351464704,
|
|
--9103104,100,100,,
|
|
1893485700865,
|
|
--9103105,110,110,,
|
|
1893485700866,
|
|
--9103106,110,110,,
|
|
1893485700867,
|
|
--9103107,110,110,,
|
|
1893485700868,
|
|
--9103108,110,110,,
|
|
1893485700869,
|
|
--9103109,110,110,,
|
|
1893485700870,
|
|
--9103110,110,110,,
|
|
1893485700871,
|
|
--9103111,110,110,,
|
|
1893485700872,
|
|
--9103112,110,110,,
|
|
1893485700873,
|
|
--9103113,110,110,,
|
|
1893485700874,
|
|
--9103114,110,110,,
|
|
1893485700875,
|
|
--9103115,110,110,,
|
|
1893821245196,
|
|
--9103116,120,110,,
|
|
1893821245197,
|
|
--9103117,120,110,,
|
|
1893821245198,
|
|
--9103118,120,110,,
|
|
1893821245199,
|
|
--9103119,120,110,,
|
|
1893821245200,
|
|
--9103120,120,110,,
|
|
1893821245201,
|
|
--9103121,120,110,,
|
|
1893821245202,
|
|
--9103122,120,110,,
|
|
1893821245203,
|
|
--9103123,120,110,,
|
|
1893821245204,
|
|
--9103124,120,110,,
|
|
1721351464801,
|
|
--9103201,100,100,,
|
|
1721351464802,
|
|
--9103202,100,100,,
|
|
1721351464803,
|
|
--9103203,100,100,,
|
|
1721351464804,
|
|
--9103204,100,100,,
|
|
1893485700965,
|
|
--9103205,110,110,,
|
|
1893485700966,
|
|
--9103206,110,110,,
|
|
1893485700967,
|
|
--9103207,110,110,,
|
|
1893485700968,
|
|
--9103208,110,110,,
|
|
1893485700969,
|
|
--9103209,110,110,,
|
|
1893485700970,
|
|
--9103210,110,110,,
|
|
1893485700971,
|
|
--9103211,110,110,,
|
|
1893485700972,
|
|
--9103212,110,110,,
|
|
1893485700973,
|
|
--9103213,110,110,,
|
|
1893485700974,
|
|
--9103214,110,110,,
|
|
1893485700975,
|
|
--9103215,110,110,,
|
|
1893821245296,
|
|
--9103216,120,110,,
|
|
1893821245297,
|
|
--9103217,120,110,,
|
|
1893821245298,
|
|
--9103218,120,110,,
|
|
1893821245299,
|
|
--9103219,120,110,,
|
|
1893821245300,
|
|
--9103220,120,110,,
|
|
1893821245301,
|
|
--9103221,120,110,,
|
|
1893821245302,
|
|
--9103222,120,110,,
|
|
1893821245303,
|
|
--9103223,120,110,,
|
|
1893821245304,
|
|
--9103224,120,110,,
|
|
}
|
|
local L_MainKeyDic = {
|
|
[6200036]=1,[6200037]=2,[6520014]=3,[9103001]=4,[9103002]=5,[9103003]=6,[9103004]=7,[9103005]=8,[9103006]=9,[9103007]=10,[9103008]=11,[9103009]=12,[9103010]=13,[9103011]=14,[9103012]=15,
|
|
[9103013]=16,[9103014]=17,[9103015]=18,[9103016]=19,[9103017]=20,[9103018]=21,[9103019]=22,[9103020]=23,[9103021]=24,[9103022]=25,[9103023]=26,[9103024]=27,[9103101]=28,[9103102]=29,[9103103]=30,
|
|
[9103104]=31,[9103105]=32,[9103106]=33,[9103107]=34,[9103108]=35,[9103109]=36,[9103110]=37,[9103111]=38,[9103112]=39,[9103113]=40,[9103114]=41,[9103115]=42,[9103116]=43,[9103117]=44,[9103118]=45,
|
|
[9103119]=46,[9103120]=47,[9103121]=48,[9103122]=49,[9103123]=50,[9103124]=51,[9103201]=52,[9103202]=53,[9103203]=54,[9103204]=55,[9103205]=56,[9103206]=57,[9103207]=58,[9103208]=59,[9103209]=60,
|
|
[9103210]=61,[9103211]=62,[9103212]=63,[9103213]=64,[9103214]=65,[9103215]=66,[9103216]=67,[9103217]=68,[9103218]=69,[9103219]=70,[9103220]=71,[9103221]=72,[9103222]=73,[9103223]=74,[9103224]=75,
|
|
}
|
|
local L_NamesByNum = {
|
|
ModelId = 1,
|
|
ReceiveScale = 2,
|
|
BrightScale = 3,
|
|
}
|
|
local L_NamesByString = {
|
|
}
|
|
local L_ColNameIndexs = {
|
|
ModelId = 0,
|
|
ReceiveScale = 1,
|
|
BrightScale = 2,
|
|
}
|
|
--local L_ColumnUseBitCount = {25,9,9,}
|
|
--local L_ColumnList = {1,1,1,}
|
|
--local L_ShiftDataList = {0,25,34,}
|
|
--local L_AndDataList = {16777215,255,255,}
|
|
local L_ColumnShiftAndList = {1,0,16777215,1,25,255,1,34,255,}
|
|
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 = 75
|
|
}
|
|
|
|
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
|