local propertyTable = { ID = 1,type = 2,Icon = 3,Name = 4,Desc1 = 5,Desc2 = 6,MaxNum = 7,Cooldown = 8,Param = 9,ServerBattleActionId1 = 10,ServerBattleActionId2 = 11,cost = 12,BattleLevelExp = 13, } 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/GuildWarBattleShop-page'..pageIndex) if DataSheetUtil then --skip fixedpoint process for data sheet checker DataSheetUtil.ProcessFixedPoint('GuildWarBattleShop', 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({1,1,1},base), setmetatable({2,1,2},base), setmetatable({4,1,3},base), setmetatable({5,1,4},base), setmetatable({6,1,5},base), setmetatable({7,1,6},base), } return { dataTable = dataTable, propertyTable = propertyTable, primaryTable = primaryTable, }