donjuan.cell¶
Module Contents¶
Classes¶
The cell represents a single ‘unit’ in the map. The attributes on the cell |
|
A cell for a square grid. |
|
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.ABCThe 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.
-
property
coordinates(self) → Tuple[int, int]¶
-
property
edges(self) → List[‘Edge’]¶
-
property
space(self) → Optional[Type[‘Space’]]¶ Spacethis cell is a part of.
-
property
x(self) → int¶
-
property
y(self) → int¶
-
property
n_sides(self) → int¶
-
property
-
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.CellA 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.CellA 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¶