From daa88e5d24881487419092298f9425a8bbfff5c1 Mon Sep 17 00:00:00 2001 From: C9Glax <13404778+C9Glax@users.noreply.github.com> Date: Sun, 5 Feb 2023 20:45:12 +0100 Subject: [PATCH] Conversion Node -> PathNode --- Pathfinding/Pathfinder.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pathfinding/Pathfinder.cs b/Pathfinding/Pathfinder.cs index d074571..99c71cf 100644 --- a/Pathfinding/Pathfinder.cs +++ b/Pathfinding/Pathfinder.cs @@ -14,7 +14,7 @@ public class Pathfinder try { startRegion = regionManager.GetRegion(start); - startNode = (PathNode)ClosestNodeToCoordinates(start, startRegion)!; //TODO null handling + startNode = PathNode.FromNode(ClosestNodeToCoordinates(start, startRegion)!); //TODO null handling } catch (FileNotFoundException e) { @@ -23,7 +23,7 @@ public class Pathfinder try { goalRegion = regionManager.GetRegion(goal); - goalNode = (PathNode)ClosestNodeToCoordinates(goal, goalRegion)!; //TODO null handling + goalNode = PathNode.FromNode(ClosestNodeToCoordinates(goal, goalRegion)!); //TODO null handling } catch (FileNotFoundException e) { @@ -47,7 +47,7 @@ public class Pathfinder foreach (Connection connection in closestNodeToGoal.GetConnections()) { - PathNode? neighbor = (PathNode?)regionManager.GetNode(connection.endNodeCoordinates); + PathNode? neighbor = (PathNode)regionManager.GetNode(connection.endNodeCoordinates); if (neighbor != null && neighbor.currentPathWeight < closestNodeToGoal.currentPathWeight + Utils.DistanceBetween(closestNodeToGoal, neighbor)) { neighbor.previousPathNode = closestNodeToGoal;