warframe-worldstate-parser
Version:
An Open parser for Warframe's Worldstate in Javascript
28 lines (24 loc) • 784 B
JavaScript
import WorldstateObject from './WorldstateObject.js';
import ChallengeInstance from './ChallengeInstance.js';
/**
* Represents a void trader
* @augments {WorldstateObject}
*/
export default class WeeklyChallenge extends WorldstateObject {
/**
* @param {object} data The Void trader data
*/
constructor(data) {
super(data);
this.challenges = data.Challenges.map((challengeData) => new ChallengeInstance(challengeData));
}
/**
* Returns a string representation of the trader
* @returns {string} string representation
*/
toString() {
return `Starts: ${this.getStartString()}\nEnds: ${this.getEndString()}\nChallenges:\n${this.challenges
.map((challenge) => `\t${challenge.toString()}`)
.join('\n')}`;
}
}