public List<Cell> CellsFromPath() { List<Cell> path = FinalPath.Select(n => n.Cell).ToList(); if (path.Count == 0) return path; path.Reverse(); path.RemoveAt(0); return path; }
public static List <Cell> PathToTarget(this GameMap gm, Cell origin, Cell goal) { var pathFinder = new AStarPathfinder(); pathFinder.FindPath(origin, goal, gm.CellGameMap, false); return(pathFinder.CellsFromPath()); }