Module:JobUnits

local p = {} local render_unit_icon = require('Module:Render/Unit')._icon

function p.jobUnitList(frame) local iname = frame.args[1] return p._jobUnitList(iname) end

function p._jobUnitList(iname) if iname == nil then return 'Invalid parameter' end

local unitList = mw.loadData("Module:Data/MasterParam/JobUnits") local units = unitList[iname] if not units then return '' end

local output = {} for i,entry in pairs( units ) do       table.insert(output, render_unit_icon({entry, size = 'small' })) end return table.concat(output, ', ') end

return p