maplestory-openapi
Version:
This JavaScript library enables the use of the MapleStory OpenAPI of Nexon.
447 lines (444 loc) • 12.9 kB
JavaScript
import { CharacterAndroidEquipmentDto as CharacterAndroidEquipmentDto$1, CharacterAndroidEquipmentFaceDto as CharacterAndroidEquipmentFaceDto$1, CharacterAndroidEquipmentHairDto as CharacterAndroidEquipmentHairDto$1, CharacterAndroidEquipmentSkinDto as CharacterAndroidEquipmentSkinDto$1, CharacterAndroidEquipmentPresetDto as CharacterAndroidEquipmentPresetDto$1, CharacterAndroidCashItemEquipmentColoringPrismDto as CharacterAndroidCashItemEquipmentColoringPrismDto$1, CharacterAndroidCashItemEquipmentOptionDto as CharacterAndroidCashItemEquipmentOptionDto$1, CharacterAndroidCashItemEquipmentDto as CharacterAndroidCashItemEquipmentDto$1 } from '../../../common/dto/character/characterAndroidEquipment.js';
/**
* 角色已裝備機器人資訊
*/
class CharacterAndroidEquipmentDto extends CharacterAndroidEquipmentDto$1 {
/**
* 要搜尋的日期 (TST,每日資料中的小時與分鐘將顯示為 0)
*/
date;
/**
* 機器人名稱
*/
androidName;
/**
* 機器人暱稱
*/
androidNickname;
/**
* 機器人圖示
*/
androidIcon;
/**
* 機器人道具描述
*/
androidDescription;
/**
* 機器人髮型資訊
*/
androidHair;
/**
* 機器人臉型資訊
*/
androidFace;
/**
* 機器人膚色資訊
*/
androidSkin;
/**
* 機器人的已裝備現金道具資訊
*/
androidCashItemEquipment;
/**
* 機器人耳飾感應器
*/
androidEarSensorClipFlag;
/**
* 機器人性別
*/
androidGender;
/**
* 機器人階級
*/
androidGrade;
/**
* 非人型機器人
*/
androidNonHumanoidFlag;
/**
* 是否具備雜貨店功能
*/
androidShopUsableFlag;
/**
* 目前套用的道具預設編號
*/
presetNo;
/**
* 預設 1 的機器人資訊
*/
androidPreset1;
/**
* 預設 2 的機器人資訊
*/
androidPreset2;
/**
* 預設 3 的機器人資訊
*/
androidPreset3;
constructor(obj) {
super();
const { date, android_name, android_nickname, android_icon, android_description, android_hair, android_face, android_skin, android_cash_item_equipment, android_ear_sensor_clip_flag, android_gender, android_grade, android_non_humanoid_flag, android_shop_usable_flag, preset_no, android_preset_1, android_preset_2, android_preset_3, } = obj;
this.date = date ? new Date(date) : null;
this.androidName = android_name;
this.androidNickname = android_nickname;
this.androidIcon = android_icon;
this.androidDescription = android_description;
this.androidHair = android_hair
? new CharacterAndroidEquipmentHairDto(android_hair)
: null;
this.androidFace = android_face
? new CharacterAndroidEquipmentFaceDto(android_face)
: null;
this.androidSkin = android_skin
? new CharacterAndroidEquipmentSkinDto(android_skin)
: null;
this.androidCashItemEquipment = android_cash_item_equipment.map((equipment) => new CharacterAndroidCashItemEquipmentDto(equipment));
this.androidEarSensorClipFlag = android_ear_sensor_clip_flag ?? null;
this.androidGender = android_gender;
this.androidGrade = android_grade;
this.androidNonHumanoidFlag = android_non_humanoid_flag;
this.androidShopUsableFlag = android_shop_usable_flag;
this.presetNo = preset_no;
this.androidPreset1 = android_preset_1
? new CharacterAndroidEquipmentPresetDto(android_preset_1)
: null;
this.androidPreset2 = android_preset_2
? new CharacterAndroidEquipmentPresetDto(android_preset_2)
: null;
this.androidPreset3 = android_preset_3
? new CharacterAndroidEquipmentPresetDto(android_preset_3)
: null;
}
}
/**
* 機器人臉型資訊
*/
class CharacterAndroidEquipmentFaceDto extends CharacterAndroidEquipmentFaceDto$1 {
/**
* 機器人臉型名稱
*/
faceName;
/**
* 機器人臉型基本顏色
*/
baseColor;
/**
* 機器人臉型混染顏色
*/
mixColor;
/**
* 機器人臉型混染顏色比例
*/
mixRate;
/**
* 自由造型券 使用狀態(0:未使用,1:已使用)
*/
freestyleFlag;
constructor(obj) {
super();
const { face_name, base_color, mix_color, mix_rate, freestyle_flag } = obj;
this.faceName = face_name;
this.baseColor = base_color;
this.mixColor = mix_color;
this.mixRate = mix_rate;
this.freestyleFlag = freestyle_flag;
}
/**
* 自由造型券 使用狀態
*/
get isFreestyleFlag() {
return this.freestyleFlag === '1';
}
}
/**
* 機器人髮型資訊
*/
class CharacterAndroidEquipmentHairDto extends CharacterAndroidEquipmentHairDto$1 {
/**
* 機器人髮型名稱
*/
hairName;
/**
* 機器人髮型基本顏色
*/
baseColor;
/**
* 機器人髮型混染顏色
*/
mixColor;
/**
* 機器人髮型混染顏色比例
*/
mixRate;
/**
* 自由造型券 使用狀態(0:未使用,1:已使用)
*/
freestyleFlag;
constructor(obj) {
super();
const { hair_name, base_color, mix_color, mix_rate, freestyle_flag } = obj;
this.hairName = hair_name;
this.baseColor = base_color;
this.mixColor = mix_color;
this.mixRate = mix_rate;
this.freestyleFlag = freestyle_flag;
}
/**
* 自由造型券 使用狀態
*/
get isFreestyleFlag() {
return this.freestyleFlag === '1';
}
}
/**
* 機器人膚色資訊
*/
class CharacterAndroidEquipmentSkinDto extends CharacterAndroidEquipmentSkinDto$1 {
/**
* 膚色名稱
*/
skinName;
/**
* 色系
*/
colorStyle;
/**
* 膚色色調
*/
hue;
/**
* 膚色彩度
*/
saturation;
/**
* 膚色明度
*/
brightness;
constructor(obj) {
super();
const { skin_name, color_style, hue, saturation, brightness } = obj;
this.skinName = skin_name;
this.colorStyle = color_style;
this.hue = hue;
this.saturation = saturation;
this.brightness = brightness;
}
}
/**
* 預設的機器人資訊
*/
class CharacterAndroidEquipmentPresetDto extends CharacterAndroidEquipmentPresetDto$1 {
/**
* 機器人名稱
*/
androidName;
/**
* 機器人暱稱
*/
androidNickname;
/**
* 機器人圖示
*/
androidIcon;
/**
* 機器人道具描述
*/
androidDescription;
/**
* 機器人性別
*/
androidGender;
/**
* 機器人階級
*/
androidGrade;
/**
*
* 機器人髮型資訊
*/
androidHair;
/**
* 機器人臉型資訊
*/
androidFace;
/**
* 機器人膚色資訊
*/
androidSkin;
/**
* 機器人耳飾感應器
*/
androidEarSensorClipFlag;
/**
* 非人型機器人
*/
androidNonHumanoidFlag;
/**
* 是否具備雜貨店功能
*/
androidShopUsableFlag;
constructor(obj) {
super();
const { android_name, android_nickname, android_icon, android_description, android_gender, android_grade, android_hair, android_face, android_skin, android_ear_sensor_clip_flag, android_non_humanoid_flag, android_shop_usable_flag, } = obj;
this.androidName = android_name;
this.androidNickname = android_nickname;
this.androidIcon = android_icon;
this.androidDescription = android_description;
this.androidGender = android_gender;
this.androidGrade = android_grade;
this.androidHair = new CharacterAndroidEquipmentHairDto(android_hair);
this.androidFace = new CharacterAndroidEquipmentFaceDto(android_face);
this.androidSkin = android_skin
? new CharacterAndroidEquipmentSkinDto(android_skin)
: null;
this.androidEarSensorClipFlag = android_ear_sensor_clip_flag;
this.androidNonHumanoidFlag = android_non_humanoid_flag;
this.androidShopUsableFlag = android_shop_usable_flag;
}
}
/**
* 機器人現金道具彩色稜鏡資訊
*/
class CharacterAndroidCashItemEquipmentColoringPrismDto extends CharacterAndroidCashItemEquipmentColoringPrismDto$1 {
/**
* 彩色稜鏡顏色範圍
*/
colorRange;
/**
* 彩色稜鏡色調
*/
hue;
/**
* 彩色稜鏡彩度
*/
saturation;
/**
* 彩色稜鏡明度
*/
value;
constructor(obj) {
super();
const { color_range, hue, saturation, value } = obj;
this.colorRange = color_range;
this.hue = hue;
this.saturation = saturation;
this.value = value;
}
}
/**
* 機器人現金道具選項
*/
class CharacterAndroidCashItemEquipmentOptionDto extends CharacterAndroidCashItemEquipmentOptionDto$1 {
/**
* 選項類型
*/
optionType;
/**
* 選項數值
*/
optionValue;
constructor(obj) {
super();
const { option_type, option_value } = obj;
this.optionType = option_type;
this.optionValue = option_value;
}
}
/**
* 機器人的已裝備現金道具資訊
*/
class CharacterAndroidCashItemEquipmentDto extends CharacterAndroidCashItemEquipmentDto$1 {
/**
* 機器人現金道具部位名稱
*/
cashItemEquipmentPart;
/**
* 機器人現金道具欄位位置
*/
cashItemEquipmentSlot;
/**
* 機器人現金道具名稱
*/
cashItemName;
/**
* 機器人現金道具圖示
*/
cashItemIcon;
/**
* 機器人現金道具描述
*/
cashItemDescription;
/**
* 機器人現金道具選項
*/
cashItemOption;
/**
* 機器人現金道具有效期間 (TST)
*/
dateExpire = null;
/**
* Whether the android cash item is expired
*/
isExpired = null;
/**
* 機器人現金道具選項有效期間 (TST,時間單位資料中的分鐘顯示為 0)
*/
dateOptionExpire = null;
/**
* Whether the android cash item option is expired
*/
isOptionExpired = null;
/**
* 機器人現金道具標籤資訊 (特殊標籤、紅標籤、黑標籤、大師標籤)
*/
cashItemLabel;
/**
* 機器人現金道具彩色稜鏡資訊
*/
cashItemColoringPrism;
/**
* 道具可裝備性別
*/
androidItemGender;
/**
* 自由造型券 使用狀態(0:未使用,1:已使用)
*/
freestyleFlag;
constructor(obj) {
super();
const { cash_item_equipment_part, cash_item_equipment_slot, cash_item_name, cash_item_icon, cash_item_description, cash_item_option, date_expire, date_option_expire, cash_item_label, cash_item_coloring_prism, android_item_gender, freestyle_flag, } = obj;
this.cashItemEquipmentPart = cash_item_equipment_part;
this.cashItemEquipmentSlot = cash_item_equipment_slot;
this.cashItemName = cash_item_name;
this.cashItemIcon = cash_item_icon;
this.cashItemDescription = cash_item_description;
this.cashItemOption = cash_item_option.map((option) => new CharacterAndroidCashItemEquipmentOptionDto(option));
this.cashItemLabel = cash_item_label;
this.cashItemColoringPrism = cash_item_coloring_prism
? new CharacterAndroidCashItemEquipmentColoringPrismDto(cash_item_coloring_prism)
: null;
this.androidItemGender = android_item_gender;
this.freestyleFlag = freestyle_flag;
if (date_expire === 'expired') {
this.isExpired = true;
}
else if (typeof date_expire === 'string') {
this.dateExpire = date_expire ? new Date(date_expire) : null;
}
if (date_option_expire === 'expired') {
this.isOptionExpired = true;
}
else if (typeof date_option_expire === 'string') {
this.dateOptionExpire = date_option_expire
? new Date(date_option_expire)
: null;
}
}
/**
* 自由造型券 使用狀態
*/
get isFreestyleFlag() {
return this.freestyleFlag === '1';
}
}
export { CharacterAndroidCashItemEquipmentColoringPrismDto, CharacterAndroidCashItemEquipmentDto, CharacterAndroidCashItemEquipmentOptionDto, CharacterAndroidEquipmentDto, CharacterAndroidEquipmentFaceDto, CharacterAndroidEquipmentHairDto, CharacterAndroidEquipmentPresetDto, CharacterAndroidEquipmentSkinDto };