donjuan.dungeon

Module Contents

Classes

Dungeon

class donjuan.dungeon.Dungeon(n_rows: Optional[int] = 5, n_cols: Optional[int] = 5, grid: Optional[Grid] = None, rooms: Optional[Dict[str, Room]] = None, hallways: Optional[Dict[str, Hallway]] = None, randomizers: Optional[List[‘Randomizer’]] = None)[source]
add_room(self, room: Room) → None[source]
add_hallway(self, hallway: Hallway) → None[source]
property grid(self) → Grid
property hallways(self) → Dict[str, Hallway]
property n_cols(self) → int
property n_rows(self) → int
property randomizers(self) → List[‘Randomizer’]
property rooms(self) → Dict[str, Room]
randomize(self) → None[source]

For each item in randomizers, run the Randomizer.randomize_dungeon() method on this dungeon.

emplace_rooms(self) → None[source]

Replace the cells in the grid with the cells of the rooms.

emplace_space(self, space: Space) → None[source]

Replace the cells in the grid with the cells of the Space, and automatically link them with the Edge`s in the `Grid.

Parameters

space (Space) – room to emplace in the grid