From 1daa45d6047bbe875825828f0db6a2f7b81bfbc4 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Thu, 19 Oct 2023 16:44:29 -0400 Subject: [PATCH] New collection utilized --- src/engine/objects/Building.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/engine/objects/Building.java b/src/engine/objects/Building.java index aa06721d..e62d9dd9 100644 --- a/src/engine/objects/Building.java +++ b/src/engine/objects/Building.java @@ -63,7 +63,6 @@ public class Building extends AbstractWorldObject { public float statAlt; public LocalDateTime upgradeDateTime = null; public LocalDateTime taxDateTime = null; - public ArrayList patrolPoints = new ArrayList<>(); public ArrayList sentryPoints = new ArrayList<>(); public TaxType taxType = TaxType.NONE; public int taxAmount; @@ -96,6 +95,7 @@ public class Building extends AbstractWorldObject { private ConcurrentHashMap timestamps = null; private ConcurrentHashMap friends; private ConcurrentHashMap condemned; + public ArrayList patrolPoints; public ProtectionState protectionState = ProtectionState.NONE; private ArrayList children = null; @@ -926,8 +926,7 @@ public class Building extends AbstractWorldObject { if (this.blueprintUUID == 0) this.setHealth(healthMax); - if (blueprint.getBuildingGroup().equals(BuildingGroup.BARRACK)) - this.patrolPoints = DbManager.BuildingQueries.LOAD_PATROL_POINTS(this); + this.patrolPoints = BuildingManager._buildingPatrolPoints.computeIfAbsent(this.getObjectUUID(), k -> new ArrayList<>()); } else { this.healthMax = 100000; // Structures with no blueprint mesh