Module:CharacterTierHelper

From Granblue Fantasy Wiki
Jump to navigation Jump to search

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

local p, dataCache = {}, mw.loadData('Module:CharacterTierHelper/Data')

function p.ResolveCharacter(frame)
	frame = frame:getParent()
	local id = frame.args.id
	id = id and id:match("%d+")

	local info = dataCache.byID[id] or dataCache.byLink[frame.args.link or frame.args.name]
	if info then
		return frame:expandTemplate({title='Template:CharacterTier/Helper', args=info})
	end
end

return p