local propertyTable = { MonthlyDay = 1,MonthlyReward = 2, } local mainPropertyTable = { MonthlyDay = 1,PageIndex = 2,LineIndex = 3, } local primaryTable = { "MonthlyDay", } 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/MonthSumReward-page'..pageIndex) if DataSheetUtil then --skip fixedpoint process for data sheet checker DataSheetUtil.ProcessFixedPoint('MonthSumReward', 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({3,1,1},base), setmetatable({8,1,2},base), setmetatable({15,1,3},base), setmetatable({21,1,4},base), setmetatable({28,1,5},base), } return { dataTable = dataTable, propertyTable = propertyTable, primaryTable = primaryTable, }