public static Route Calculate(System Start, System End) { var path = Pathfinder.PathFinder.FindPath(Start, End); if (path == null) { return(null); } Data.Route retRoute = new Data.Route(); while (path.next != null) { retRoute.AddDirect(path.System); path = path.next; } retRoute.AddDirect(End); return(retRoute); }
public SystemMap() { InitializeComponent(); map1.InitializeMap(); map1.OnVisibleSystemsChanged += map1_OnVisibleSystemsChanged; var path = Pathfinder.PathFinder.FindPath(UserData.System, GlobalData.Systems[0]); Data.Route testRoute = new Data.Route(); while (path.next != null) { testRoute.AddDirect(path.System); path = path.next; } map1.Routes.Add(testRoute); map1.Refresh(); }