public static int GetNumberOfSurroundingBombs(this TileGrid grid, Tile tile) { int result = 0; var neighbors = GetNeighbors(grid, tile); foreach (var neighbor in neighbors) { if (neighbor.CompareTag(Bomb.Tag)) { result++; } } return(result); }
public static int GetNumberOfSurroundingBombs(this TileGrid grid, Tile tile) { int result = 0; var neighbors = GetNeighbors(grid, tile); foreach (var neighbor in neighbors) { if (neighbor.CompareTag(Bomb.Tag)) { result++; } } return(result); }