Break up room and corridor generation into generate and apply phases

- Generate creates rooms and corridors, and apply applies them to a tile grid.
- Add up and down stairs generation to the Room Generators.
- Clean up Room.wall_points and Room.floor_points to make it easier to
  write a generic apply() method on RoomGenerator
This commit is contained in:
Eryn Wells 2023-02-10 21:06:34 -08:00
parent d4c4b5d879
commit c59dc1b907
4 changed files with 122 additions and 72 deletions

View file

@ -17,7 +17,10 @@ class Map:
self.generator = generator
self.tiles = np.full(tuple(size), fill_value=Empty, order='F')
self.generator.generate(self.tiles)
generator.generate(self.tiles)
self.up_stairs = generator.up_stairs
self.down_stairs = generator.down_stairs
# Map tiles that are currently visible to the player
self.visible = np.full(tuple(self.size), fill_value=True, order='F')