Module:Players

local p = { index = { "Kara", "Wiellste_Gunsmithy", } }

--retuns a mapping from player name to player module function p.getAllPlayers local retVal = {} for i, name in ipairs(p.index) do       local player if pcall(function player = p.getPlayer(name) end) then retVal[name]=player else retVal[name]=nil end end return retVal end

function p.getPlayer(name) return require('Module:Player_' .. name) end

--dumps a table, useful for debugging function p.tdump(o) if type(o) == 'table' then local s = '{ ' for k,v in pairs(o) do        if type(k) ~= 'number' then k = '"'..k..'"' end s = s .. '['..k..'] = ' .. p.tdump(v) .. ','     end return s .. '} '  else return tostring(o) end end

return p