fix up some things

This commit is contained in:
2024-07-14 23:45:26 +02:00
parent 0649004e51
commit 0ef5d72275
6 changed files with 22 additions and 14 deletions
-11
View File
@@ -3,23 +3,12 @@ export default class Item {
readonly id: string;
readonly name: string;
readonly level: number;
readonly scripType: ScripType | null;
constructor(id: string, data: {[key: string]: number | string | undefined}) {
this.id = id;
this.name = data?.name as string;
this.level = data?.level as number;
const scripType: string | undefined = data?.scripType as string;
if (scripType != undefined) {
this.scripType = typeof data?.scripType === "string" ? scripType.toUpperCase() as ScripType : null;
} else {
this.scripType = null;
}
}
}
enum ScripType {
WHITE = 'white',
PURPLE = 'purple',
}
+1
View File
@@ -28,6 +28,7 @@ export default class Node {
this.times = times;
this.items = items;
this.nearestAetheryte = nearestAetheryte;
items.sort((a, b) => b.level - a.level);
}
isActive(eorzeaTime: EorzeaTime): boolean {