Module:Freezing A1

From Aether Project Wiki
Jump to navigation Jump to search
This is the documentation page. It will be transcluded into the main module page. See Template:Documentation for more information

This module implements {{Freezing-A1}}.

Parent arguments are automatically merged with directly passed arguments (the latter overwriting the former).

Dependencies

See also


local p = {}

local i18n = {
	defaultFuel = 'Any freezer fuel',
	moduleArgs = [[Module:ProcessArgs]],
	moduleRecipe = [[Module:Recipe table]],
	type = 'Freezing',
}
p.i18n = i18n

local recipeTable = require( i18n.moduleRecipe ).table

function p.table( f )
	local args = f
	if f == mw.getCurrentFrame() then
		args = require( i18n.moduleArgs ).merge( true )
	else
		f = mw.getCurrentFrame()
	end
	
	args.Input = args[1]
	args.Output = args[2]
	args.Experience = args[3]
	args.Time = args[4]
	args.Fuel = args.fuel or i18n.defaultFuel
	
	local title = mw.title.getCurrentTitle()
	
	local out = recipeTable( args, {
		uiFunc = 'freezer_a1',
		type = args.link or (title.isSubpage and mw.title.getCurrentTitle().rootText .. '/' .. i18n.type .. '|' .. i18n.type) or i18n.type,
		ingredientArgs = { 'Input', 'Fuel' },
		outputArgs = { 'Output' },
	} )
	
	return out, category
end

return p