donjuan.hallway

Module Contents

Classes

Hallway

A hallway in a dungeon. It has a start and end cell.

class donjuan.hallway.Hallway(ordered_cells: Optional[List[Cell]] = None, name: Union[int, str] = '')[source]

Bases: donjuan.space.Space

A hallway in a dungeon. It has a start and end cell.

Parameters
  • ordered_cells (Optional[Sequence[Cell]]) – ordered list of cells, where the order defines the path of the hallway. If None defaults to an empty list.

  • name (Union[int, str], optional) – defaults to ‘’, the name of the hallway

property ordered_cells(self) → List[Cell]

Cells that make up the path of the hallway. Does not contain extra cells that may be associated with this object (i.e. those off of the “path”). For the set of all cells, use cells.

property end_cell(self) → Cell
property start_cell(self) → Cell
append_ordered_cell_list(self, cells: List[Cell]) → None[source]

Append cells in order to the hallway. To add a cell to the hallway without including it in the hallways path, use add_cells().

Parameters

cells – (List[Cell]): cells to append to the hallway

get_coordinate_path(self) → List[Tuple[int, int]][source]

Get the coordinates of the cells that make up this path this hallway takes. Does not contain coordinates of extra cells on this object.

Returns

coordinates of the hallway path