@ginstone/nga-api
Version:
48 lines (47 loc) • 1.56 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MissionStatus = exports.MissionDetail = exports.MissionInfo = void 0;
class MissionInfo {
constructor(raw) {
this.id = raw.id;
this.name = raw.name;
this.info = raw.info;
this.detail = raw.detail;
this.status = raw.stat;
this.missionDetail = new MissionDetail(raw.raw_detail);
this.missionStatus = new MissionStatus(raw.raw_stat);
}
}
exports.MissionInfo = MissionInfo;
class MissionDetail {
constructor(raw) {
this.id = raw["1"];
this.type = raw["4"];
this.coolDownDays = raw["5"];
this.event = raw["6"];
this.name = raw["9"];
this.info = raw["10"];
this.forumId = raw["12"];
this.topicId = raw["13"];
this.groupId = raw["14"];
this.counterType = raw["15"];
this.countGroup = raw["20"];
this.order = raw["21"];
this.startTime = new Date(raw["22"] * 1000);
this.endTime = new Date(raw["11"] * 1000);
}
}
exports.MissionDetail = MissionDetail;
class MissionStatus {
constructor(raw) {
this.count = raw["1"];
this.total = raw["2"];
this.completedTime = new Date(raw["3"] * 1000);
this.lastCountTime = new Date(raw["4"] * 1000);
this.customCounter = raw["5"];
this.thisCountTime = raw["7"];
let today = new Date().setHours(0, 0, 0, 0) / 1000;
this.countedToday = raw["4"] > today;
}
}
exports.MissionStatus = MissionStatus;