public void DijkstraRouteSelector_CanFindPaths() { WorldGeometry worldMap = new GraphWorldMap(100, 100, 0, 50); RouteSelector routeSelector = new DijkstraRouteSelector((GraphWorldMap)worldMap); string[] routeSteps = routeSelector.GetRoute(40, 2, 40, 85); foreach (string step in routeSteps) { Console.WriteLine(step); } }
public void Generate() { GraphWorldMap worldMap = new GraphWorldMap(30, 30, 4, 15); DijkstraRouteSelector routeSelector = new DijkstraRouteSelector(worldMap); StartVertex = worldMap.GetVertex(3, 24); EndVertex = worldMap.GetVertex(27, 2); Route = routeSelector.GetRoute(StartVertex, EndVertex); RouteSelector = routeSelector; World = worldMap; NotifyPropertyChanged(nameof(StartVertex)); NotifyPropertyChanged(nameof(EndVertex)); NotifyPropertyChanged(nameof(Route)); NotifyPropertyChanged(nameof(RouteSelector)); NotifyPropertyChanged(nameof(World)); }