UNPKG

maplestory-openapi

Version:

This JavaScript library enables the use of the MapleStory OpenAPI of Nexon.

112 lines (107 loc) 3.04 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var unionArtifact = require('../../../common/dto/union/unionArtifact.js'); /** * Union artifact information */ class UnionArtifactDto extends unionArtifact.UnionArtifactDto { /** * Reference date for query (SGT, daily data with hours and minutes set to 0) */ date; /** * Artifact effect information */ unionArtifactEffect; /** * Artifact crystal information */ unionArtifactCrystal; /** * Remaining artifact AP */ unionArtifactRemainAp; constructor(obj) { super(); const { date, union_artifact_effect, union_artifact_crystal, union_artifact_remain_ap, } = obj; this.date = date ? new Date(date) : null; this.unionArtifactEffect = union_artifact_effect.map((effect) => new UnionArtifactEffectDto(effect)); this.unionArtifactCrystal = union_artifact_crystal.map((crystal) => new UnionArtifactCrystalDto(crystal)); this.unionArtifactRemainAp = union_artifact_remain_ap; } } /** * Artifact effect information */ class UnionArtifactEffectDto extends unionArtifact.UnionArtifactEffectDto { /** * Name of the artifact effect */ name; /** * Level of the artifact effect */ level; constructor(obj) { super(); const { name, level } = obj; this.name = name; this.level = level; } } /** * Artifact crystal information */ class UnionArtifactCrystalDto extends unionArtifact.UnionArtifactCrystalDto { /** * Name of the artifact crystal */ name; /** * Validity of the stat (0:Valid, 1:Invalid) */ validityFlag; /** * Expiration date of the stat (SGT) */ dateExpire = null; /** * Whether the artifact crystal is expired */ isExpired = null; /** * Grade of the artifact crystal */ level; /** * First option of the artifact crystal */ crystalOptionName1; /** * Second option of the artifact crystal */ crystalOptionName2; /** * Third option of the artifact crystal */ crystalOptionName3; constructor(obj) { super(); const { name, validity_flag, date_expire, level, crystal_option_name_1, crystal_option_name_2, crystal_option_name_3, } = obj; this.name = name; this.validityFlag = validity_flag; this.level = level; this.crystalOptionName1 = crystal_option_name_1; this.crystalOptionName2 = crystal_option_name_2; this.crystalOptionName3 = crystal_option_name_3; if (date_expire === 'expired') { this.isExpired = true; } else if (typeof date_expire === 'string') { this.dateExpire = date_expire ? new Date(date_expire) : null; } } } exports.UnionArtifactCrystalDto = UnionArtifactCrystalDto; exports.UnionArtifactDto = UnionArtifactDto; exports.UnionArtifactEffectDto = UnionArtifactEffectDto;