From 9d2d2b9e3dde57cea1ed2169247753f1c1c016ba Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 3 Dec 2023 16:46:14 -0500 Subject: [PATCH] Minor reformat --- src/engine/gameManager/BuildingManager.java | 31 ++++++++++----------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/src/engine/gameManager/BuildingManager.java b/src/engine/gameManager/BuildingManager.java index d5b70d38..d3383a57 100644 --- a/src/engine/gameManager/BuildingManager.java +++ b/src/engine/gameManager/BuildingManager.java @@ -49,6 +49,7 @@ public enum BuildingManager { public static HashMap> _buildingFriends = new HashMap<>(); public static HashMap> _buildingCondemned = new HashMap<>(); public static HashMap> _buildingPatrolPoints = new HashMap<>(); + public static int getAvailableSlot(Building building) { ArrayList slotLocations = _slotLocations.get(building.meshUUID); @@ -145,10 +146,7 @@ public enum BuildingManager { if (Guild.sameGuild(building.getGuild(), player.getGuild()) && GuildStatusController.isInnerCouncil(player.getGuildStatus())) return true; - if (Guild.sameGuild(building.getGuild(), player.getGuild()) && GuildStatusController.isGuildLeader(player.getGuildStatus())) - return true; - - return false; + return Guild.sameGuild(building.getGuild(), player.getGuild()) && GuildStatusController.isGuildLeader(player.getGuildStatus()); //TODO test friends list once added //does not meet above criteria. Cannot access. @@ -987,15 +985,15 @@ public enum BuildingManager { float X = building.getBounds().getHalfExtents().x; float Y = building.getBounds().getHalfExtents().y; ArrayList cornersAndFaces = new ArrayList<>(); - cornersAndFaces.add(new Vector2f(building.loc.x - X,building.loc.z - Y)); - cornersAndFaces.add(new Vector2f(building.loc.x + X,building.loc.z + Y)); - cornersAndFaces.add(new Vector2f(building.loc.x + X,building.loc.z - Y)); - cornersAndFaces.add(new Vector2f(building.loc.x - X,building.loc.z + Y)); - cornersAndFaces.add(new Vector2f(building.loc.x - X,building.loc.z)); - cornersAndFaces.add(new Vector2f(building.loc.x + X,building.loc.z)); - cornersAndFaces.add(new Vector2f(building.loc.x,building.loc.z - Y)); - cornersAndFaces.add(new Vector2f(building.loc.x,building.loc.z + Y)); - for(Vector2f point : cornersAndFaces){ + cornersAndFaces.add(new Vector2f(building.loc.x - X, building.loc.z - Y)); + cornersAndFaces.add(new Vector2f(building.loc.x + X, building.loc.z + Y)); + cornersAndFaces.add(new Vector2f(building.loc.x + X, building.loc.z - Y)); + cornersAndFaces.add(new Vector2f(building.loc.x - X, building.loc.z + Y)); + cornersAndFaces.add(new Vector2f(building.loc.x - X, building.loc.z)); + cornersAndFaces.add(new Vector2f(building.loc.x + X, building.loc.z)); + cornersAndFaces.add(new Vector2f(building.loc.x, building.loc.z - Y)); + cornersAndFaces.add(new Vector2f(building.loc.x, building.loc.z + Y)); + for (Vector2f point : cornersAndFaces) { if (!NavigationManager.pointIsBlocked(new Vector3fImmutable(point.x, building.loc.y, point.y))) { building.parentZone.navNodes.add(new PathingUtilities.Node(point, null, building)); } @@ -1029,13 +1027,11 @@ public enum BuildingManager { // Build Path from vertices - for (Vector2f vertex : vertices) { - + for (Vector2f vertex : vertices) if (outPath.getCurrentPoint() == null) outPath.moveTo(vertex.x, vertex.y); else outPath.lineTo(vertex.x, vertex.y); - } outPath.closePath(); return outPath; @@ -1047,7 +1043,8 @@ public enum BuildingManager { building.meshes = new ArrayList<>(); - if(_hull_data.get(building.meshUUID) == null || _hull_data.get(building.meshUUID).size() < 1) + if (_hull_data.get(building.meshUUID) == null || + _hull_data.get(building.meshUUID).size() < 1) return; for (Path2D.Float path : _hull_data.get(building.meshUUID)) {