Module:RegionLister/MapRegions

From Terra Invicta Official Wiki

Documentation for this module may be created at Module:RegionLister/MapRegions/doc

---
---Reads the Region data files and computes a table of MapRegions to Regions

--region Dependencies
local RegionData = mw.loadData('Module:CSVReader/Region')
--endregion

--region Private constants
--endregion

--region Private member variables
local mapRegionTable = {}
--endregion

--region Private methods

-- TODO: This may cause problems when the 2070 scenario is added...
function getMapRegionTable()
	for rowID, row in pairs(RegionData) do
		if string.sub(rowID,1,4) ~= '2070' and string.sub(rowID,1,4) ~= '2026' then 
			mapRegionTable[row['mapRegionName']] = rowID
		end
	end
	return mapRegionTable
end

--endregion

--region Public methods
--endregion

return getMapRegionTable()