Module:PlayerResults

local util_args = require('Module:ArgsUtil') local util_cargo = require('Module:CargoUtil') local util_esports = require('Module:EsportsUtil') local util_html = require('Module:HtmlUtil') local util_map = require('Module:MapUtil') local util_table = require('Module:TableUtil') local util_text = require('Module:TextUtil') local util_toggle = require('Module:ToggleUtil') local util_tournament = require('Module:TournamentUtil') local util_vars = require('Module:VarsUtil') local i18n = require('Module:i18nUtil') local lang = mw.getLanguage('en')

local Results = require('Module:PlayerResultsAbstract'):extends

function Results:init self:super('init', 'Player') self.limitOverviewpage = 10 self.limitEverything = 500 self.COLUMNS = { 'Game', 'Date', 'PlaceDisplay', 'PrizeDisplay', 'Tournament', 'TeamDisplay', 'Roster' } end

local p = {}

function p.main(frame) local args = util_args.merge return Results:run(args) end

function Results:getSubject(args) return args[1] or mw.title.getCurrentTitle.baseText end

-- cargo function Results:getTables(args) local tables = self:super('getTables', args) table.insert(tables, 1, 'TournamentPlayers=TP') if util_args.castAsBool(args.noredirects) then return tables end tables[#tables+1] = 'PlayerRedirects=PR' return tables end

function Results:getJoin(args) local join = self:super('getJoin', args) table.insert(join, 1, 'TP.PageAndTeam=Res.PageAndTeam') if util_args.castAsBool(args.noredirects) then return join end table.insert(join, 2, 'TP.Player=PR.AllName') return join end

function Results:getFields(args) local fields = self:super('getFields', args) fields[#fields+1] = 'TP.Player=ThisName' return fields end

function Results:getOrderBy(args) local orderBy = self:super('getOrderBy', args) return ('%s, TP.TeamOrder DESC'):format(orderBy) end

function Results:getSubjectWhereCondition(args, subject) if util_args.castAsBool(args.noredirects) then return ('TP.Player = "%s"'):format(subject) end return ('PR.OverviewPage="%s"'):format(subject) end

function Results:getTypeWhereCondition(args) if args.type then return ('T.EventType="%s"'):format(args.type) end end

-- format rows function Results:getOneMember(link, row) return util_esports.playerLinkedOrBold(link, row.ThisName) end

-- output function Results:makeHeaderText(subject) return i18n.print('TournamentResults', subject) end

function Results:finalizeTable(tbl, result, subject) -- pass end

return p