Module:TechLister/Orgs

From Terra Invicta Official Wiki

Documentation for this module may be created at Module:TechLister/Orgs/doc

---
---Reads the Org data files and computes a table of Tech to Org unlocks

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

--region Private constants
--endregion

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

--region Private methods

function getOrgTable()
	for rowID, row in pairs(OrgData) do
		local reqTech = row['requiredTechName']
		if reqTech then
			if not orgTable[reqTech] then
				orgTable[reqTech] = {}
			end
			orgTable[reqTech][rowID] = true
		end
	end
	return orgTable
end

--endregion

--region Public methods
--endregion

return getOrgTable()