UNPKG

fnbr

Version:

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

64 lines 3.33 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const Base_1 = tslib_1.__importDefault(require("../Base")); const TournamentWindow_1 = tslib_1.__importDefault(require("./TournamentWindow")); /** * Represents a Fortnite tournament */ class Tournament extends Base_1.default { /** * @param client The main client * @param tournamentData The tournament data * @param tournamentDisplayData The tournament display data * @param templates The tournament template */ constructor(client, tournamentData, tournamentDisplayData, templates) { super(client); this.id = tournamentData.eventId; this.regions = tournamentData.regions; this.regionMappings = tournamentData.regionMappings; this.platforms = tournamentData.platforms; this.platformMappings = tournamentData.platformMappings; this.displayDataId = tournamentData.displayDataId; this.eventGroup = tournamentData.eventGroup; this.announcementTime = new Date(tournamentData.announcementTime); this.appId = tournamentData.appId; this.environment = tournamentData.environment; this.metadata = tournamentData.metadata; this.beginTime = new Date(tournamentData.beginTime); this.endTime = new Date(tournamentData.endTime); this.colors = { titleColor: tournamentDisplayData.title_color, backgroundTextColor: tournamentDisplayData.background_text_color, backgroundRightColor: tournamentDisplayData.background_right_color, backgroundLeftColor: tournamentDisplayData.background_left_color, shadowColor: tournamentDisplayData.shadow_color, posterFadeColor: tournamentDisplayData.poster_fade_color, baseColor: tournamentDisplayData.base_color, highlightColor: tournamentDisplayData.highlight_color, }; this.images = { loadingScreenImage: tournamentDisplayData.loading_screen_image, posterBackImage: tournamentDisplayData.poster_back_image, posterFrontImage: tournamentDisplayData.poster_front_image, playlistTileImage: tournamentDisplayData.playlist_tile_image, }; this.texts = { pinEarnedText: tournamentDisplayData.pin_earned_text, pinScoreRequirement: tournamentDisplayData.pin_score_requirement, scheduleInfo: tournamentDisplayData.schedule_info, flavorDescription: tournamentDisplayData.flavor_description, shortFormatTitle: tournamentDisplayData.short_format_title, titleLine1: tournamentDisplayData.title_line_1, titleLine2: tournamentDisplayData.title_line_2, detailsDescription: tournamentDisplayData.details_description, longFormatTitle: tournamentDisplayData.long_format_title, backgroundTitle: tournamentDisplayData.background_title, }; this.windows = tournamentData.eventWindows .map((w) => { var _a; return new TournamentWindow_1.default(this, w, (_a = templates.find((t) => t.windowId === w.eventWindowId)) === null || _a === void 0 ? void 0 : _a.templateData); }); } } exports.default = Tournament; //# sourceMappingURL=Tournament.js.map