easyPlace initial

This commit is contained in:
ForestOfLight
2025-03-15 04:43:11 -07:00
Unverified
parent 830b54e55a
commit 21ec447e0e
6 changed files with 204 additions and 40 deletions
+7
View File
@@ -8,6 +8,9 @@ class StructureCollection {
}
add(name) {
if (this.#structures[name]) {
throw new Error(`Structure ${name} already exists.`);
}
const structure = new Structure(name);
this.#structures[name] = structure;
return structure;
@@ -26,6 +29,10 @@ class StructureCollection {
struct.remove();
delete this.#structures[name];
}
getStructuresAtLocation(location) {
return Object.values(this.#structures).filter(structure => structure.isLocationActive(structure.toStructureCoords(location)));
}
}
export const structureCollection = new StructureCollection();