UNPKG

fnbr

Version:

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

34 lines 1.58 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const STWItem_1 = tslib_1.__importDefault(require("./STWItem")); /** * Represents a Save The World profile's hero loadout */ class STWHeroLoadout extends STWItem_1.default { /** * @param client The main client * @param id The item ID * @param data The loadout data */ constructor(client, id, data) { var _a, _b, _c, _d; super(client, id, data); this.loadoutIndex = data.attributes.loadout_index; this.teamPerk = data.attributes.team_perk !== '' ? data.attributes.team_perk : undefined; this.commanderSlot = data.attributes.crew_members.commanderslot; this.supportSquad = [ data.attributes.crew_members.followerslot1 || undefined, data.attributes.crew_members.followerslot2 || undefined, data.attributes.crew_members.followerslot3 || undefined, data.attributes.crew_members.followerslot4 || undefined, data.attributes.crew_members.followerslot5 || undefined, ]; this.gadgets = [ (_b = (_a = data.attributes.gadgets) === null || _a === void 0 ? void 0 : _a.find((g) => g.slot_index === 0)) === null || _b === void 0 ? void 0 : _b.gadget, (_d = (_c = data.attributes.gadgets) === null || _c === void 0 ? void 0 : _c.find((g) => g.slot_index === 1)) === null || _d === void 0 ? void 0 : _d.gadget, ]; } } exports.default = STWHeroLoadout; //# sourceMappingURL=STWHeroLoadout.js.map