コード例 #1
0
        private ActionResult <List <int[]> > CalculateShortestPath <T>(ShortestPathRequest shortestPathRequest, PathFinderService <T> pathFinderService) where T : PathFinder
        {
            var shortestPath = pathFinderService.GetShortestPath(shortestPathRequest);

            if (shortestPath == null)
            {
                return(NoContent());
            }
            return(shortestPath.ToList());
        }
コード例 #2
0
 public ActionResult <List <int[]> > AStar([FromServices] PathFinderService <AStar> pathFinderService, ShortestPathRequest shortestPathRequest)
 {
     return(CalculateShortestPath(shortestPathRequest, pathFinderService));
 }
コード例 #3
0
 public List <int[]> GetShortestPath(ShortestPathRequest shortestPathRequest)
 {
     return(_pathFinder.FindShortestPath(shortestPathRequest.Matrix.ToArray(), shortestPathRequest.StartVector, shortestPathRequest.EndVector));
 }