Module:Sandbox/Emptylord/Patch

-- local p        = {} local lib      = require('Module:Feature') local userError = require('Dev:User error')

function p.get(frame) local args; if frame.args == nil then args = lib.arguments(frame) else args = lib.arguments(frame.args) end local get      = require ('Module:Sandbox/Emptylord/Patch/getter') local champname = args['champname']    or args[1] local set      = tonumber(args['set']) or tonumber(args[2]) local datatype = args['datatype']      or args[3] local result = get[datatype](champname, set) if (datatype == "active" or dataype == "passive ") and result ~= nil then return frame:preprocess(result) elseif result == nil then return "" else return result end end

function p.getRoster(frame) local args; if frame.args == nil then args = lib.arguments(frame) else args = lib.arguments(frame.args) end local datatable = require('Module:Sandbox/Emptylord/Patch/data') local set       = args['2'] or "All" local champtable = {} local roster    = "" for champname in pairs(datatable) do       table.insert(champtable, champname) end table.sort(champtable) for _, champname in pairs(champtable) do       if set == "All" or champion["type"] == set then roster = roster .. ""       end end return frame:preprocess(roster) end

return p -- --