/// <summary> /// Gets the specified cell's neighbors. /// </summary> public static IEnumerable <T> GetNeighbors <T>(this IGrid <T> grid, int x, int y, GridNeighborType neighborType = GridNeighborType.Axis) { foreach (var neighbor in GetNeighborCoordinates(grid, x, y, neighborType)) { yield return(grid[in neighbor]);
/// <summary> /// Gets the specified cell's neighbors. /// </summary> public static IEnumerable <T> GetNeighbors <T>(this IGrid <T> grid, IntVector co, GridNeighborType neighborType = GridNeighborType.Axis) { return(GetNeighbors(grid, co.X, co.Y, neighborType)); }