UNPKG

fnbr

Version:

A library to interact with Epic Games' Fortnite HTTP and XMPP services

52 lines 3.11 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Represents a Fortnite tournament window */ class TournamentWindow { /** * @param tournament The tournament this window belongs to * @param windowData The tournament window's data * @param tournamentWindowTemplateData The tournament window's template data */ constructor(tournament, windowData, tournamentWindowTemplateData) { Object.defineProperty(this, 'tournament', { value: tournament }); // Window data this.id = windowData.eventWindowId; this.countdownBeginTime = new Date(windowData.countdownBeginTime); this.beginTime = new Date(windowData.beginTime); this.endTime = new Date(windowData.endTime); this.blackoutPeriods = windowData.blackoutPeriods; this.round = windowData.round; this.payoutDelay = windowData.payoutDelay; this.isTBD = windowData.isTBD; this.canLiveSpectate = windowData.canLiveSpectate; this.scoreLocations = windowData.scoreLocations; this.visibility = windowData.visibility; this.requireAllTokens = windowData.requireAllTokens; this.requireAnyTokens = windowData.requireAnyTokens; this.requireNoneTokensCaller = windowData.requireNoneTokensCaller; this.requireAllTokensCaller = windowData.requireAllTokensCaller; this.requireAnyTokensCaller = windowData.requireAnyTokensCaller; this.additionalRequirements = windowData.additionalRequirements; this.teammateEligibility = windowData.teammateEligibility; this.metadata = windowData.metadata; // Template data this.playlistId = tournamentWindowTemplateData === null || tournamentWindowTemplateData === void 0 ? void 0 : tournamentWindowTemplateData.playlistId; this.matchCap = tournamentWindowTemplateData === null || tournamentWindowTemplateData === void 0 ? void 0 : tournamentWindowTemplateData.matchCap; this.liveSessionAttributes = tournamentWindowTemplateData === null || tournamentWindowTemplateData === void 0 ? void 0 : tournamentWindowTemplateData.liveSessionAttributes; this.scoringRules = tournamentWindowTemplateData === null || tournamentWindowTemplateData === void 0 ? void 0 : tournamentWindowTemplateData.scoringRules; this.tiebreakerFormula = tournamentWindowTemplateData === null || tournamentWindowTemplateData === void 0 ? void 0 : tournamentWindowTemplateData.tiebreakerFormula; this.payoutTable = tournamentWindowTemplateData === null || tournamentWindowTemplateData === void 0 ? void 0 : tournamentWindowTemplateData.payoutTable; } /** * Fetches the results for this tournament window * @param page The results page index * @param showLiveSessions Whether to show live sessions */ async getResults(page = 0, showLiveSessions = false) { return this.tournament.client.tournaments.getWindowResults(this.tournament.id, this.id, showLiveSessions, page); } } exports.default = TournamentWindow; //# sourceMappingURL=TournamentWindow.js.map