UNPKG

enka-network-api

Version:

Enka-network API wrapper for Genshin Impact.

30 lines (29 loc) 979 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SkillAttributeAssets = void 0; const DynamicTextAssets_1 = require("./DynamicTextAssets"); class SkillAttributeAssets extends DynamicTextAssets_1.DynamicTextAssets { constructor(id, paramList, enka) { super(id, { paramList }, enka); } /** * @throws AssetsNotFoundError */ getAttributeData(lang) { const replacedData = this.getReplacedData([], lang); const split = replacedData.text.split("|"); return { name: split[0], valueText: split[1], usedNumbers: replacedData.usedParamIndices.map(i => this.dynamicData.paramList[i]) }; } /** * @returns null instead of throwing AssetsNotFoundError. */ getNullableAttributeData(lang) { try { return this.getAttributeData(lang); } catch (_a) { return null; } } } exports.SkillAttributeAssets = SkillAttributeAssets;