示例#1
0
        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);
        }
示例#2
0
 public Tile HasTileOfTypeAdjacentTo(TileContent tileContent, Point pos)
 {
     return(NavUtils.ForEachAdjacentTile(pos).Select(point => _graph.NodeAt(point).Tile).FirstOrDefault(tileAt => tileAt.TileType == tileContent));
 }