예제 #1
0
        public Path DoSearch(PathGraph.eSearchScoreSpot searchType)
        {
            //create a new path graph if required
            const int ResetAfterMinutes = 15;

            if (PathGraph == null || this.continent != locationFrom.Continent || (DateTime.Now - startTime).TotalMinutes >= ResetAfterMinutes)
            {
                CreatePathGraph(locationFrom.Continent);
            }

            PatherPath.Graph.PathGraph.SearchEnabled = true;

            // tell the pathgraph which type of search to do
            PathGraph.searchScoreSpot = searchType;

            //slow down the search if required.
            PathGraph.sleepMSBetweenSpots = 0;

            try
            {
                return(PathGraph.CreatePath(locationFrom, locationTo, 5, null));
            }
            catch (Exception ex)
            {
                logger.WriteLine(ex.Message);
                return(null);
            }
        }
예제 #2
0
        public Path DoSearch(PathGraph.eSearchScoreSpot searchType)
        {
            var path = search.DoSearch(searchType);

            OnPathCreated?.Invoke(path);
            lastPath = path;
            return(path);
        }
예제 #3
0
        public Path DoSearch(PathGraph.eSearchScoreSpot searchType)
        {
            //create a new path graph if required
            if (PathGraph == null || this.continent != locationFrom.Continent)
            {
                CreatePathGraph(locationFrom.Continent);
            }

            PatherPath.Graph.PathGraph.SearchEnabled = true;

            // tell the pathgraph which type of search to do
            PathGraph.searchScoreSpot = searchType;

            //slow down the search if required.
            PathGraph.sleepMSBetweenSpots = 0;

            var path = PathGraph.CreatePath(locationFrom, locationTo, 5, null);

            return(path);
        }