UNPKG

maplestory-openapi

Version:

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

106 lines (103 loc) 2.97 kB
import { UnionArtifactDto as UnionArtifactDto$1, UnionArtifactEffectDto as UnionArtifactEffectDto$1, UnionArtifactCrystalDto as UnionArtifactCrystalDto$1 } from '../../../common/dto/union/unionArtifact.js'; /** * Union artifact information */ class UnionArtifactDto extends UnionArtifactDto$1 { /** * 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 UnionArtifactEffectDto$1 { /** * 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 UnionArtifactCrystalDto$1 { /** * 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; } } } export { UnionArtifactCrystalDto, UnionArtifactDto, UnionArtifactEffectDto };