Module:Minion/Templates

local string, table = require('Module:String'), require('Module:Table') local minionData = mw.loadData('Module:Minion/Data')

local function to(a, b)	local arrow = '➜' return ('%s%s%s'):format(a, arrow, b) end

local function getMinionsTemplate local ret = {} table.each(table.keys(minionData), function(name)		local stats = minionData[name].stats		local description = minionData[name].description or 'No Description'		local max = table.length(stats)		local max_ = string._toRoman(max)		for i, v in ipairs(stats) do	   	table.push(ret, { name, string._toRoman(i), description, v.tba, v.storage, id = '{o} Minion {0}' })		end		local f, l = stats[1], stats[max]    	table.push(ret, { name, to('I', max_), description, to(f.tba, l.tba), to(f.storage, l.storage), id = '{o} Minion', name = '{o} Minion', image = '{o} Minion ' .. max_ })	end) return ret end

-- For Debugging -- local p = { main = getMinionsTemplate } -- return p

-- Actual Usage return getMinionsTemplate