UNPKG

ps2census

Version:

Client to connect to the PS2 Event Stream websocket.

26 lines 1.13 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AttackerEvent = void 0; const character_event_1 = require("./character.event"); const constants_1 = require("../../constants"); class AttackerEvent extends character_event_1.CharacterEvent { attacker() { if (this.attacker_character_id == '0') return Promise.resolve(undefined); return this.client.characterManager.fetch(this.attacker_character_id); } get attacker_faction() { return (AttackerEvent.loadoutFactionMap.get(this.attacker_loadout_id) ?? constants_1.Faction.NONE); } get attacker_loadout() { const loadout = AttackerEvent.loadoutTypeMap.get(this.attacker_loadout_id); if (loadout === undefined) throw new TypeError(`Unknown attacker_loadout_id when determining loadout: ${this.attacker_loadout_id}`); return loadout; } } exports.AttackerEvent = AttackerEvent; AttackerEvent.loadoutFactionMap = constants_1.loadoutFactionMap; AttackerEvent.loadoutTypeMap = constants_1.loadoutTypeMap; //# sourceMappingURL=attacker.event.js.map