UNPKG

genshin-manager

Version:

<div align="center"> <p> <a href="https://www.npmjs.com/package/genshin-manager"><img src="https://img.shields.io/npm/v/genshin-manager.svg?maxAge=3600" alt="npm version" /></a> <a href="https://www.npmjs.com/package/genshin-manager"><img src="https:

60 lines (59 loc) 2.66 kB
"use strict"; var _a; Object.defineProperty(exports, "__esModule", { value: true }); exports.CharacterProfile = void 0; const Client_1 = require("../../client/Client"); /** * Class of character's profile */ class CharacterProfile { /** * Create a Profile * @param characterId Character ID */ constructor(characterId) { this.characterId = characterId; const fetterInfoJson = Client_1.Client._getJsonFromCachedExcelBinOutput('FetterInfoExcelConfigData', this.characterId); this.fetterId = fetterInfoJson.fetterId; const birthMonth = fetterInfoJson.infoBirthMonth; const birthDay = fetterInfoJson.infoBirthDay; this.birthDate = birthMonth ? new Date(0, birthMonth - 1, birthDay) : undefined; this.native = Client_1.Client._cachedTextMap.get(String(fetterInfoJson.avatarNativeTextMapHash)) || ''; this.vision = Client_1.Client._cachedTextMap.get(String(fetterInfoJson.avatarVisionAfterTextMapHash)) || Client_1.Client._cachedTextMap.get(String(fetterInfoJson.avatarVisionBeforTextMapHash)) || ''; this.constellation = Client_1.Client._cachedTextMap.get(String(fetterInfoJson.avatarConstellationAfterTextMapHash)) || Client_1.Client._cachedTextMap.get(String(fetterInfoJson.avatarConstellationBeforTextMapHash)) || ''; this.title = Client_1.Client._cachedTextMap.get(String(fetterInfoJson.avatarTitleTextMapHash)) || ''; this.detail = Client_1.Client._cachedTextMap.get(String(fetterInfoJson.avatarDetailTextMapHash)) || ''; this.assocType = fetterInfoJson.avatarAssocType; this.cv = { CHS: Client_1.Client._cachedTextMap.get(String(fetterInfoJson.cvChineseTextMapHash)) || '', JP: Client_1.Client._cachedTextMap.get(String(fetterInfoJson.cvJapaneseTextMapHash)) || '', EN: Client_1.Client._cachedTextMap.get(String(fetterInfoJson.cvEnglishTextMapHash)) || '', KR: Client_1.Client._cachedTextMap.get(String(fetterInfoJson.cvKoreanTextMapHash)) || '', }; } /** * Get all character IDs * @returns All character IDs */ static get allCharacterIds() { const profileDatas = Object.values(Client_1.Client._getCachedExcelBinOutputByName('FetterInfoExcelConfigData')); return profileDatas.map((data) => data.avatarId); } } exports.CharacterProfile = CharacterProfile; _a = CharacterProfile; (() => { Client_1.Client._addExcelBinOutputKeyFromClassPrototype(_a.prototype); })();