Browse Source

Minor reformat

hull7
MagicBot 12 months ago
parent
commit
9d2d2b9e3d
  1. 31
      src/engine/gameManager/BuildingManager.java

31
src/engine/gameManager/BuildingManager.java

@ -49,6 +49,7 @@ public enum BuildingManager {
public static HashMap<Integer, ConcurrentHashMap<Integer, BuildingFriends>> _buildingFriends = new HashMap<>(); public static HashMap<Integer, ConcurrentHashMap<Integer, BuildingFriends>> _buildingFriends = new HashMap<>();
public static HashMap<Integer, ConcurrentHashMap<Integer, Condemned>> _buildingCondemned = new HashMap<>(); public static HashMap<Integer, ConcurrentHashMap<Integer, Condemned>> _buildingCondemned = new HashMap<>();
public static HashMap<Integer, ArrayList<Vector3fImmutable>> _buildingPatrolPoints = new HashMap<>(); public static HashMap<Integer, ArrayList<Vector3fImmutable>> _buildingPatrolPoints = new HashMap<>();
public static int getAvailableSlot(Building building) { public static int getAvailableSlot(Building building) {
ArrayList<BuildingLocation> slotLocations = _slotLocations.get(building.meshUUID); ArrayList<BuildingLocation> slotLocations = _slotLocations.get(building.meshUUID);
@ -145,10 +146,7 @@ public enum BuildingManager {
if (Guild.sameGuild(building.getGuild(), player.getGuild()) && GuildStatusController.isInnerCouncil(player.getGuildStatus())) if (Guild.sameGuild(building.getGuild(), player.getGuild()) && GuildStatusController.isInnerCouncil(player.getGuildStatus()))
return true; return true;
if (Guild.sameGuild(building.getGuild(), player.getGuild()) && GuildStatusController.isGuildLeader(player.getGuildStatus())) return Guild.sameGuild(building.getGuild(), player.getGuild()) && GuildStatusController.isGuildLeader(player.getGuildStatus());
return true;
return false;
//TODO test friends list once added //TODO test friends list once added
//does not meet above criteria. Cannot access. //does not meet above criteria. Cannot access.
@ -987,15 +985,15 @@ public enum BuildingManager {
float X = building.getBounds().getHalfExtents().x; float X = building.getBounds().getHalfExtents().x;
float Y = building.getBounds().getHalfExtents().y; float Y = building.getBounds().getHalfExtents().y;
ArrayList<Vector2f> cornersAndFaces = new ArrayList<>(); ArrayList<Vector2f> 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 - 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 + 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));
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){ for (Vector2f point : cornersAndFaces) {
if (!NavigationManager.pointIsBlocked(new Vector3fImmutable(point.x, building.loc.y, point.y))) { if (!NavigationManager.pointIsBlocked(new Vector3fImmutable(point.x, building.loc.y, point.y))) {
building.parentZone.navNodes.add(new PathingUtilities.Node(point, null, building)); building.parentZone.navNodes.add(new PathingUtilities.Node(point, null, building));
} }
@ -1029,13 +1027,11 @@ public enum BuildingManager {
// Build Path from vertices // Build Path from vertices
for (Vector2f vertex : vertices) { for (Vector2f vertex : vertices)
if (outPath.getCurrentPoint() == null) if (outPath.getCurrentPoint() == null)
outPath.moveTo(vertex.x, vertex.y); outPath.moveTo(vertex.x, vertex.y);
else else
outPath.lineTo(vertex.x, vertex.y); outPath.lineTo(vertex.x, vertex.y);
}
outPath.closePath(); outPath.closePath();
return outPath; return outPath;
@ -1047,7 +1043,8 @@ public enum BuildingManager {
building.meshes = new ArrayList<>(); 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; return;
for (Path2D.Float path : _hull_data.get(building.meshUUID)) { for (Path2D.Float path : _hull_data.get(building.meshUUID)) {

Loading…
Cancel
Save