Module:Korok Seeds

local p = {}

local DataTable = require("Module:Data Table") local Franchise = require("Module:Franchise") local utilsArg = require("Module:UtilsArg") local utilsTable = require("Module:UtilsTable")

function p.Main(frame) local args = utilsArg.parse(frame:getParent.args, p.Templates["Korok Seeds"]) local rows = DataTable.parseRows(args.cells or {}) local columns = p.getColumns(args.game) local dataTable = DataTable.printTable(rows, {		game = args.game,		columns = columns,	}) return dataTable end

function p.getColumns(game) local graphicsType = Franchise.graphics(game) local gameConfig = Data.games[game] or {} local config = utilsTable.merge({}, gameConfig) local columns = {}

local korokColumn = string.format("Korok ") table.insert(columns, korokColumn) local typeColumn = string.format("Type [Term][Nowrap]") table.insert(columns, typeColumn) table.insert(columns, "Coordinates [Nowrap]") table.insert(columns, "Notes [Description]") return columns end

p.Templates = { ["Treasure Chests"] = { params = { game = { required = true, desc = "A game code.", type = "string", enum = Franchise.enum, },			["..."] = {				name = "cells", type = "content", trim = true, },		},		tableParams = { {				name = "korok", desc = "An image of the Korok.", tags = {"Image"}, },			{				name = "type", desc = "The Korok Seed Puzzle type.", tags = {"Term"}, },			{				name = "coordinates", desc = "Precise location of the Korok Seed Puzzle.", optional = true, tags = {"Nowrap"}, },			{				name = "notes", desc = "Notes on how to locate the Korok in the area.", tags = {"Description"}, },		},	}, }

return p