Module:RecipeDetails
From IdleOn MMO Wiki
Documentation for this module may be created at Module:RecipeDetails/doc
local p = {}
local cargo = mw.ext.cargo
-- Takes a list of items and an optional iterator for indentation.
function p.RecipeBreakdownRecursive(items, i)
local indent = i or 1 -- Used to set padding later.
local fullTableStruct = {
-- inserted as ( indent, itemName, amount )
}
for n = 1, #items do -- Should be a max of 4 items per recipe.
-- Insert item into fullTableStruct.
-- Query smithing table for the recipe and retrieve the ingeredients
-- If previous line's result is not nil then recursively call this function and increment i.
end
return fullTableStruct
end
local function RecipeBreakdownFormatter(fullList)
local result = ''
local Row = [==[<tr></tr>]==]
-- Format output rows.
-- Concatenate strings together.
return result
end
local function RecipeTotalsFormatter(fullList)
local result = ''
local Row = [==[<tr></tr>]==]
-- Sort list
-- Add same ingrediets together.
-- Format output rows.
-- Concatenate strings together.
return result
end
-- Query smithing table for the recipe and retrieve the ingeredients
local function getReecipeItems( item )
-- Query
-- Return table of items and values.
end
function p.builder( frame )
local item = frame.args[1]
-- build the data and store it in the table.
end
function p.Main( frame )
-- Query smithing table for the recipe and retrieve the ingeredients
-- return table data for item
end
return p