Add Direction.all() that returns an iterator that produces all the Direction values
This commit is contained in:
parent
1247617b87
commit
1cd45d366b
2 changed files with 13 additions and 12 deletions
|
|
@ -196,17 +196,7 @@ class RoomsAndCorridorsGenerator(MapGenerator):
|
|||
if tiles[x, y] != Floor:
|
||||
continue
|
||||
|
||||
neighbors = [
|
||||
pos + Direction.North,
|
||||
pos + Direction.NorthEast,
|
||||
pos + Direction.East,
|
||||
pos + Direction.SouthEast,
|
||||
pos + Direction.South,
|
||||
pos + Direction.SouthWest,
|
||||
pos + Direction.West,
|
||||
pos + Direction.NorthWest,
|
||||
]
|
||||
|
||||
neighbors = (pos + direction for direction in Direction.all())
|
||||
for neighbor in neighbors:
|
||||
if tiles[neighbor.x, neighbor.y] != Empty:
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue