local propertyTable = { ID = 1,CountryName = 2,CountryFullName = 3,CountryTC = 4,LogoPath = 5,NamePath = 6,NamePlatePath = 7,NamePlateNamePath = 8,CountryBGPath = 9,SquareLogo = 10,CountryPlatePath = 11,CountryIntro = 12,CountryReignTitle = 13,CountryFontColor = 14,CountryNotice = 15,CountryAnnouncement = 16,SceneId = 17,WantedNPCID = 18,PVPMapID = 19,PosId = 20,PatrolPosId = 21,UIPath = 22,UIFlag = 23,UnSelectImage = 24, } 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/CountryBase-page'..pageIndex) if DataSheetUtil then --skip fixedpoint process for data sheet checker DataSheetUtil.ProcessFixedPoint('CountryBase', 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({3,1,3},base), setmetatable({4,1,4},base), setmetatable({99,1,5},base), } return { dataTable = dataTable, propertyTable = propertyTable, primaryTable = primaryTable, }