zone data now contains aetheryte list

This commit is contained in:
2024-07-18 19:59:05 +02:00
parent b3ec17f2c0
commit a50ea1273d
4 changed files with 205 additions and 200 deletions
+9 -1
View File
@@ -1,13 +1,21 @@
import Aetheryte from "@/entities/Aetheryte";
export default class Zone {
name: {
en: string,
}
constructor(data: {name: {en: string}}) {
aetherytes: Array<Aetheryte> = [];
constructor(data: {name: {en: string}, aetherytes: Array<{position: {x: number, y: number, zone: string}, name: {en: string}}>}) {
this.name = {
en: data.name.en
};
if (!Array.isArray(data.aetherytes)) return;
for (const aetheryte of data.aetherytes) {
this.aetherytes.push(new Aetheryte(aetheryte));
}
}
}