コード例 #1
0
        public bool AddTarget(System System, Station Station, int JumpCount = 0)
        {
            if (System == LastStep.System && Station == LastStep.Station)
            {
                return(true);
            }

            var path = Pathfinder.PathFinder.FindPath(LastStep.System, System, JumpCount);

            if (path == null)
            {
                return(false);
            }

            Data.Route retRoute = new Data.Route();
            while (path.next != null)
            {
                AddDirect(path.System);
                path = path.next;
            }

            AddDirect(System, Station);

            return(true);
        }
コード例 #2
0
ファイル: SystemMap.cs プロジェクト: maxkhl/EliteTrading
        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();
        }
コード例 #3
0
        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);
        }