Module:PoliticalParty/data

From EarthMC
Jump to navigation Jump to search

Documentation for this module may be created at Module:PoliticalParty/data/doc

p = {}
local data = require("Module:PoliticalParty/data")

function nameConvert(arg)
	if data.partyNames[arg] ~= nil then
		return data.partyNames[arg]
	else
		return arg
	end
end

p.color = function(frame)
    local arg = frame.args[1]
	return data.parties[nameConvert(arg)][1]
end

p.shortname = function(frame)
    local arg = frame.args[1]
	return data.parties[nameConvert(arg)][2]
end

p.altname = function(frame)
    local arg = frame.args[1]
	return data.parties[nameConvert(arg)][3]
end

p.tablecolor = function(frame)
    local arg = frame.args[1]
	return data.parties[nameConvert(arg)][4]
end

return p