Made Map.neighbourhood a static method

This commit is contained in:
Charles Peyrat
2021-01-08 04:36:57 +01:00
parent 3229eb8ea7
commit ffa7641b21
2 changed files with 6 additions and 3 deletions

View File

@ -106,7 +106,7 @@ class Generator:
for x in range(width):
for y in range(height):
if grid[y][x] == Tile.EMPTY:
c = sum([1 if grid[j][i] == Tile.FLOOR else 0 for j, i in result.neighbourhood(y, x, large=True)])
c = sum([1 if grid[j][i] == Tile.FLOOR else 0 for j, i in Map.neighbourhood(grid, y, x, large=True)])
if c == 4 and self.params["no_lone_walls"]:
result.tiles[y][x] = Tile.FLOOR
elif c > 0: