mirror of
https://github.com/YouHaveTrouble/DiscipleOfLand.git
synced 2026-05-12 06:26:56 +00:00
fix up some things
This commit is contained in:
@@ -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',
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user