Module:Phase

From SMITE Esports Wiki
Jump to: navigation, search

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

local util_args = require('Module:ArgsUtil')
local LOOKUP = mw.loadData('Module:Phasenames')

local h = {}

function h.getInfo(str, settings)
	if not str then str = '' end
	settings.vars = util_args.lookupVars(str, LOOKUP, true) or { long = str, medium = str, short = str }
	return
end

local p = {}
function p.longname(str, settings)
	if not settings then settings = {} end
	h.getInfo(str, settings)
	return settings.vars.long
end

function p.mediumname(str, settings)
	if not settings then settings = {} end
	h.getInfo(str, settings)
	return settings.vars.medium
end

function p.shortname(str, settings)
	if not settings then settings = {} end
	h.getInfo(str, settings)
	return settings.vars.short
end

return p