Module:ExtendedRosterLine

local p = {}

function p.extendedRosterLine( frame ) if frame == mw.getCurrentFrame then args = require( 'Module:ProcessArgs' ).merge( true ) else frame = mw.getCurrentFrame end local Flags = mw.loadData( 'Module:Flagnames') local Role = require('Module:Role').role local nRoles = args['roles'] or "1" if args['roles'] then nRoles = args['roles'] else -- if we are doing just one role then act like it's multiple roles but with only one defined args['role1'] = args['role'] or '' args['r1'] = args['r'] or '' startindex = '' end local cellFlag = "|rowspan=" .. nRoles .. "| " .. (Flags[mw.ustring.lower(args['flag'] or '')] or ' ') local cellRole = "||" .. Role{args['role1'] or ' ',"onlyimage"} local cellID = "||rowspan=" .. nRoles .. "| "	if args['noid'] == nil then cellID = cellID .. "\'\'\'" .. (args['player'] or ' ') .. "\'\'\'" end if args['footnote'] then cellID = cellID .. "" .. args['footnote'] .. ""	end local cellName = "|| rowspan=" .. nRoles .. "| " .. (args['name'] or '') local ynSwitch = { y = ' ', n = ' ' }	local rounds = { } local cellRounds = "" for i = 1, nRoles do		if i ~= 1 then cellRounds = cellRounds .. "\n|-\n|" .. Role{args['role' .. i] or '',"onlyimage"} end local rounds = args['r' .. i] or "" for round in string.gmatch(rounds, '[^,]+') do			mw.text.trim(round) cellRounds = cellRounds .. "|| style=\"text-align:center;white-space:nowrap;\" valign=\"center\" | " for game in string.gmatch(round,'.') do cellRounds = cellRounds .. (ynSwitch[game] or '') end end end local line = "|-\n" .. cellFlag .. cellRole .. cellID .. cellName .. cellRounds return line end return p