local propertyTable = { ID = 1,TowerLevelCountry = 2,ClimbTower = 3,LevelNum = 4,BattleLevelNum = 5,ShowChapReward = 6,ShowNextChapReward = 7,BGUI = 8,Unlock_Table = 9, } local mainPropertyTable = { ID = 1,PageIndex = 2,LineIndex = 3, } local primaryTable = { "ID", } local DataPageEntry = {} local rawget = rawget local base = { __index = function(t, k) local propertyIndex = propertyTable[k] if propertyIndex then local mainPropertyIndex = mainPropertyTable[k] if mainPropertyIndex then return t[mainPropertyIndex] end local pageIndex = t[2] local pageData = DataPageEntry[pageIndex] if pageData == nil then pageData = require('Data/NationClimbTowerData-page'..pageIndex) if DataSheetUtil then --skip fixedpoint process for data sheet checker DataSheetUtil.ProcessFixedPoint('NationClimbTowerData', pageData) end DataPageEntry[pageIndex] = pageData end local lineIndex = t[3] local resultData = pageData[lineIndex] return resultData[propertyIndex] end end, __newindex = function() error('Attempt to modify read-only table') end } local dataTable = { setmetatable({110000,1,1},base), setmetatable({120000,1,2},base), setmetatable({130000,1,3},base), setmetatable({140000,1,4},base), } return { dataTable = dataTable, propertyTable = propertyTable, primaryTable = primaryTable, }