Threadsafe for masstesting variables.

This commit is contained in:
2023-04-21 15:13:42 +02:00
parent 6373874495
commit 976108569b
2 changed files with 13 additions and 7 deletions

View File

@ -9,7 +9,6 @@ public class Pathfinder
{
public RegionManager regionManager;
public readonly string workingDir;
public PathResult? pathResult;
public Dictionary<OsmNode, double>? gScore;
private Dictionary<OsmNode, OsmNode>? _cameFromDict;
@ -20,7 +19,11 @@ public class Pathfinder
if (!Path.Exists(workingDirectory))
throw new DirectoryNotFoundException(workingDirectory);
regionManager = new(workingDirectory);
workingDir = workingDirectory;
}
public Pathfinder(RegionManager regionManager)
{
this.regionManager = regionManager;
}
public Pathfinder AStar(Coordinates startCoordinates, Coordinates goalCoordinates,