Module:PricesBTD6

-- local p = {}

local data = require("Module:PricesBTD6/data") local all_prices = data.prices

Table local table_head = [=[
 * Listed prices exclude buffs, sacrifices, and Monkey Knowledge.

{| class="article-table" style="width:100%" ! ! colspan="4" | Purchase ! colspan="4" | Sell ! Upgrades ! Easy ! Medium ! Hard ! Impoppable ! Easy ! Medium ! Hard ! Impoppable ]=]

local table_row = [=[ ]=]
 * Upgrade Cost (%s)
 * %s
 * %s
 * %s
 * %s
 * %s

function p.Table(frame) local price_name = frame.args[1] ~= "" and frame.args[1] or mw.title.getCurrentTitle.text local price_path = frame.args[2] ~= "" and frame.args[2] local price = all_prices[price_name] local displaytable = table_head for i, value in pairs(price) do displaytable = displaytable .. table_row:format(			price_name, 			price.Path,			price.Path,			price.Path,			price.Path		) end return frame:preprocess(displaytable .. "|}") end

return p