donjuan.cell

Module Contents

Classes

Cell

The cell represents a single ‘unit’ in the map. The attributes on the cell

SquareCell

A cell for a square grid.

HexCell

A cell for a hexagonal grid.

class donjuan.cell.Cell(filled: bool = False, door_space: Optional[DoorSpace] = None, contents: Optional[List[Any]] = None, coordinates: Optional[Tuple[int, int]] = None, space: Optional[‘Space’] = None, edges: Optional[List[‘Edge’]] = None)

Bases: abc.ABC

The cell represents a single ‘unit’ in the map. The attributes on the cell define what exists in that unit. This includes the terrain, doors, walls, lights, other room details etc.

set_coordinates(self, y: int, x: int) → None[source]
set_edges(self, edges: List[‘Edge’]) → None[source]
set_space(self, space: Type[‘Space’]) → None[source]
set_x(self, x: int) → None[source]
set_y(self, y: int) → None[source]
property coordinates(self) → Tuple[int, int]
property edges(self) → List[‘Edge’]
property space(self) → Optional[Type[‘Space’]]

Space this cell is a part of.

property x(self) → int
property y(self) → int
property n_sides(self) → int
class donjuan.cell.SquareCell(filled: bool = False, door_space: Optional[DoorSpace] = None, contents: Optional[List[Any]] = None, coordinates: Optional[Tuple[int, int]] = None)[source]

Bases: donjuan.cell.Cell

A cell for a square grid.

Parameters
  • filled (bool, optional) – flag indicating whether the cell is filled (default False)

  • door_space (Optional[DoorSpace]) – kind of doorway in this cell

  • contents (Optional[List[Any]]) – things in this cell

_n_sides = 4
class donjuan.cell.HexCell(filled: bool = False, door_space: Optional[DoorSpace] = None, contents: Optional[List[Any]] = None, coordinates: Optional[Tuple[int, int]] = None)[source]

Bases: donjuan.cell.Cell

A cell for a hexagonal grid.

Parameters
  • filled (bool, optional) – flag indicating whether the cell is filled (default False)

  • door_space (Optional[DoorSpace]) – kind of doorway in this cell

  • contents (Optional[List[Any]]) – things in this cell

_n_sides = 6