Refactored Zone to new system

This commit is contained in:
2023-10-18 08:33:49 -04:00
parent e689cb541a
commit 5ed21f9b76
5 changed files with 13 additions and 30 deletions
+2 -16
View File
@@ -12,7 +12,6 @@ package engine.objects;
import engine.Enum;
import engine.InterestManagement.Terrain;
import engine.db.archive.DataWarehouse;
import engine.gameManager.DbManager;
import engine.gameManager.ZoneManager;
import engine.math.Bounds;
import engine.math.Vector2f;
@@ -292,19 +291,6 @@ public class Zone extends AbstractWorldObject {
return this.parentZoneID;
}
public ArrayList<Zone> getNodes() {
if (this.nodes == null) {
this.nodes = DbManager.ZoneQueries.GET_MAP_NODES(super.getObjectUUID());
//Add reverse lookup for child->parent
if (this.nodes != null)
for (Zone zone : this.nodes)
zone.setParent(this);
}
return nodes;
}
/*
* Serializing
*/
@@ -323,10 +309,10 @@ public class Zone extends AbstractWorldObject {
if (this.equals(ZoneManager.seaFloor))
return false;
if (this.getNodes().isEmpty())
if (this.nodes.isEmpty())
return false;
if (this.getNodes().get(0).isMacroZone())
if (this.nodes.get(0).isMacroZone())
return true;
return this.parent.equals(ZoneManager.seaFloor);