|
|
|
@ -14,6 +14,7 @@ import engine.math.Bounds;
@@ -14,6 +14,7 @@ import engine.math.Bounds;
|
|
|
|
|
import engine.math.Vector2f; |
|
|
|
|
import engine.math.Vector3f; |
|
|
|
|
import engine.math.Vector3fImmutable; |
|
|
|
|
import engine.mobileAI.utilities.PathingUtilities; |
|
|
|
|
import engine.objects.Building; |
|
|
|
|
import engine.objects.City; |
|
|
|
|
import engine.objects.Zone; |
|
|
|
@ -21,6 +22,7 @@ import engine.objects.ZoneTemplate;
@@ -21,6 +22,7 @@ import engine.objects.ZoneTemplate;
|
|
|
|
|
import engine.server.MBServerStatics; |
|
|
|
|
import org.pmw.tinylog.Logger; |
|
|
|
|
|
|
|
|
|
import java.awt.geom.Path2D; |
|
|
|
|
import java.time.Instant; |
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
import java.time.ZoneId; |
|
|
|
@ -433,4 +435,18 @@ public enum ZoneManager {
@@ -433,4 +435,18 @@ public enum ZoneManager {
|
|
|
|
|
|
|
|
|
|
return localAltitude < zone.sea_level; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static void LinkNavNodes(){ |
|
|
|
|
for(Zone zone : getAllZones()){ |
|
|
|
|
for(PathingUtilities.Node node : zone.navNodes){ |
|
|
|
|
for(PathingUtilities.Node potentialNeighbor : zone.navNodes){ |
|
|
|
|
for (Path2D.Float obstacle : zone.navObstacles) { |
|
|
|
|
if (!node.equals(potentialNeighbor) && !obstacle.intersects(node.location.x, node.location.y, potentialNeighbor.location.x, potentialNeighbor.location.y)){ |
|
|
|
|
node.neighbors.add(potentialNeighbor); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|