UNPKG

enka-network-api

Version:

Enka-network API wrapper for Genshin Impact.

26 lines (25 loc) 1.84 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ObjectKeysManager = void 0; class ObjectKeysManager { constructor(cachedAssetsManager) { var _a, _b, _c, _d; const waterAetherSkillDepot = cachedAssetsManager.getExcelData("AvatarSkillDepotExcelConfigData", 503); if (!waterAetherSkillDepot) throw new Error("Failed to find the water aether skill depot."); this.characterArkheKey = (_a = Object.entries(waterAetherSkillDepot).find(([, value]) => value === "Ousia")) === null || _a === void 0 ? void 0 : _a[0]; const aetherProfilePicture = cachedAssetsManager.getExcelData("ProfilePictureExcelConfigData", 1); if (!aetherProfilePicture) throw new Error("Failed to find the aether profile picture."); this.profilePictureTypeKey = (_b = Object.entries(aetherProfilePicture).find(([, value]) => value === "PROFILE_PICTURE_UNLOCK_BY_AVATAR")) === null || _b === void 0 ? void 0 : _b[0]; const mavuikaElementalBurst = cachedAssetsManager.getExcelData("AvatarSkillExcelConfigData", 11065); if (!mavuikaElementalBurst) throw new Error("Failed to find the mavuika elemental burst."); this.elementalBurstMaxChargeKey = (_c = Object.entries(mavuikaElementalBurst).find(([, value]) => value === 200)) === null || _c === void 0 ? void 0 : _c[0]; this.elementalBurstRequiredKey = (_d = Object.entries(mavuikaElementalBurst).find(([, value]) => value === 100)) === null || _d === void 0 ? void 0 : _d[0]; const invalidKeys = Object.entries(this).filter(entry => entry[1] === undefined).map(entry => entry[0]); if (invalidKeys.length > 0) throw new Error(`Invalid keys detected: ${invalidKeys.join(", ")}`); } } exports.ObjectKeysManager = ObjectKeysManager;