warframe-worldstate-parser
Version:
An Open parser for Warframe's Worldstate in Javascript
38 lines (37 loc) • 1.34 kB
JavaScript
import { n as __decorateMetadata, t as __decorate } from "../../decorate-BCC26nnB.mjs";
import { IsBoolean, IsString } from "class-validator";
import { languageString } from "warframe-worldstate-data/utilities";
//#region lib/models/Simaris.ts
/**
* Contains information about sanctuary targets
*/
var Simaris = class {
/**
* The sanctuary target
*/
target;
/**
* Whether or not the target is currently active
*/
isTargetActive;
/**
* @param data The sanctuary data
* @param deps The dependencies object
* @param deps.locale Locale to use for translations
*/
constructor(data, { locale } = { locale: "en" }) {
if (!data || !Object.keys(data).length) data = { LastCompletedTargetType: "" };
this.target = languageString(data.LastCompletedTargetType, locale) || "N/A";
this.isTargetActive = !data.LastCompletedTargetType;
}
/**
* A string representation of the current sanctuary status
*/
get asString() {
return `Simaris's ${this.isTargetActive ? "current" : "previous"} objective ${this.isTargetActive ? "is" : "was"} ${this.target}`;
}
};
__decorate([IsString(), __decorateMetadata("design:type", String)], Simaris.prototype, "target", void 0);
__decorate([IsBoolean(), __decorateMetadata("design:type", Boolean)], Simaris.prototype, "isTargetActive", void 0);
//#endregion
export { Simaris };