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()); }
public ActionResult <List <int[]> > AStar([FromServices] PathFinderService <AStar> pathFinderService, ShortestPathRequest shortestPathRequest) { return(CalculateShortestPath(shortestPathRequest, pathFinderService)); }
public List <int[]> GetShortestPath(ShortestPathRequest shortestPathRequest) { return(_pathFinder.FindShortestPath(shortestPathRequest.Matrix.ToArray(), shortestPathRequest.StartVector, shortestPathRequest.EndVector)); }