Fortnite Esports Wiki

Adviser Program and 2022 Power Ranking Systems, read what's new here!

READ MORE

Fortnite Esports Wiki
Advertisement

To edit the documentation or categories for this module, click here.


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 m_team = require('Module:Team')

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

function Results:init()
	self:super('init', 'Player')
	self.limitOverviewpage = 10
	self.limitEverything = 500
	self.COLUMNS = { 'Date', 'TeamSize', 'PlaceDisplay', 'PRPoints', 'Region', 'Platform', '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)
	if util_args.castAsBool(args.noredirects) then return tables end
	table.insert(tables, 1, 'PlayerRedirects=PR')
	return tables
end

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

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

function Results:getSubjectWhereCondition(args, subject)
	return ('PR.OverviewPage="%s"'):format(subject)
end

-- format rows

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

function Results:getTeamDisplay(row)
	return m_team.rightshortlinked(row.ThisTeam)
end

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

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

return p
Advertisement