public List <Node> ShortestPathNextTo(Point pos, Point origin) { foreach (var point in NavUtils.ForEachAdjacentTile(pos)) { _aStar = new AStar(_graph); var path = _aStar.FindShortestPath(origin, point); if (path != null) { return(path); } } return(null); }
public Tile HasTileOfTypeAdjacentTo(TileContent tileContent, Point pos) { return(NavUtils.ForEachAdjacentTile(pos).Select(point => _graph.NodeAt(point).Tile).FirstOrDefault(tileAt => tileAt.TileType == tileContent)); }