--文件是自动生成,请勿手动修改.来自数据文件:immortal_soul_iattice local L_CompressMaxColumn = 1 local L_CompressData = { 4275179171941, --101,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_0,, 4276252913766, --102,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_2,, 4277326655591, --103,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_4,, 4278668832872, --104,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_11,, 9974869209193, --105,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_15,, 4280011010154, --106,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_19,, 4281353187435, --107,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_23,, 9975137644745, --201,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_39,, 9975942951114, --202,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_47,, 9977016692939, --203,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_55,, 9977821999308, --204,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_63,, 9978627305677, --205,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_71,, 9979432612046, --206,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_79,, 9979701047503, --207,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_83,, 9980237918509, --301,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_87,, 1421441839406, --302,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_91,, 9981311660335, --303,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_95,, 9981580095792, --304,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_99,, 9982385402161, --305,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_109,, 9983190708530, --306,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_119,, 9983459143987, --307,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_129,, 9983727579537, --401,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_139,, 9984532885906, --402,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_149,, 9985338192275, --403,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_159,, 9985606627732, --404,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_169,, 9986411934101, --405,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_179,, 9987217240470, --406,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_189,, 9987485675927, --407,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_199,, 9987754111477, --501,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_209,, 9988827853302, --502,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_219,, 9989364724215, --503,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_229,, 9989633159672, --504,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_239,, 9989901595129, --505,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_249,, 9990170030586, --506,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_259,, 9990438466043, --507,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_269,, 9990706901593, --601,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_279,, 9990975337050, --602,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_289,, 9991243772507, --603,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_299,, 9991512207964, --604,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_309,, 9991780643421, --605,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_319,, 9992049078878, --606,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_329,, 9992317514335, --607,1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_41_42_43_44_45_46_47,150_339,, } local L_MainKeyDic = { [101]=1,[102]=2,[103]=3,[104]=4,[105]=5,[106]=6,[107]=7,[201]=8,[202]=9,[203]=10,[204]=11,[205]=12,[206]=13,[207]=14,[301]=15, [302]=16,[303]=17,[304]=18,[305]=19,[306]=20,[307]=21,[401]=22,[402]=23,[403]=24,[404]=25,[405]=26,[406]=27,[407]=28,[501]=29,[502]=30, [503]=31,[504]=32,[505]=33,[506]=34,[507]=35,[601]=36,[602]=37,[603]=38,[604]=39,[605]=40,[606]=41,[607]=42,} local L_NamesByNum = { IatticeId = 1, } local L_NamesByString = { Type = 2, Condition = 3, } local L_ColNameIndexs = { IatticeId = 0, Type = 1, Condition = 2, } --local L_ColumnUseBitCount = {11,17,17,} --local L_ColumnList = {1,1,1,} --local L_ShiftDataList = {0,11,28,} --local L_AndDataList = {1023,65535,65535,} local L_ColumnShiftAndList = {1,0,1023,1,11,65535,1,28,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 = 42 } 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