Fandom

Civilization

Module:Data/CivBE/Utils

< Module:Data | CivBE

6,958pages on
this wiki
Add New Page
Talk0

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

local baseUtils = require("Module:Data")
 
local p = {}
 
 
function p.GetCivilization(name,expansion)
    expansion = expansion or "Base"
 
    local civData = mw.loadData("Module:Data/CivBE/"..expansion.."/Civilizations")
 
	local baseData = baseUtils.SelectFromWhere(civData, "Description", name)
    or baseUtils.SelectFromWhere(civData, "ShortDescription", name)
 
    if not baseData then
    	for _,civ in pairs(civData) do
        	if civ.CivilopediaTag and (civ.CivilopediaTag.TITLE == name) then
        	    return civ
        	end
    	end
end
 
    return baseData
end
 
return p

Also on Fandom

Random Wiki