Add a bunch of doc strings and header comments to files
This commit is contained in:
parent
633580e27a
commit
4050ac5c6f
7 changed files with 25 additions and 3 deletions
|
@ -64,7 +64,7 @@ class BumpAction(MoveAction):
|
|||
|
||||
Attributes
|
||||
----------
|
||||
direction : Direction
|
||||
direction : Vector
|
||||
The direction to test
|
||||
'''
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
# Eryn Wells <eryn@erynwells.me>
|
||||
|
||||
'''
|
||||
The game's graphical user interface
|
||||
'''
|
||||
|
||||
from typing import List
|
||||
|
||||
from tcod.console import Console
|
||||
|
|
|
@ -82,6 +82,7 @@ class Map:
|
|||
return self.tile_is_in_bounds(point) and self.tiles[point.x, point.y]['walkable']
|
||||
|
||||
def point_is_explored(self, point: Point) -> bool:
|
||||
'''Return True if the tile at the given point has been explored by the player'''
|
||||
return self.tile_is_in_bounds(point) and self.explored[point.x, point.y]
|
||||
|
||||
def highlight_points(self, points: Iterable[Point]):
|
||||
|
|
|
@ -12,13 +12,16 @@ class MapGenerator:
|
|||
|
||||
@property
|
||||
def up_stairs(self) -> List[Point]:
|
||||
'''The location of any routes to a higher floor of the dungeon.'''
|
||||
raise NotImplementedError()
|
||||
|
||||
@property
|
||||
def down_stairs(self) -> List[Point]:
|
||||
'''The location of any routes to a lower floor of the dungeon.'''
|
||||
raise NotImplementedError()
|
||||
|
||||
def generate(self, tiles: np.ndarray):
|
||||
'''Generate a map and place it in `tiles`'''
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# Eryn Wells <eryn@erynwells.me>
|
||||
|
||||
'''
|
||||
Defines an abstract CorridorGenerator and several concrete subclasses. These classes generate corridors between rooms.
|
||||
'''
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
from typing import Iterator
|
||||
# Eryn Wells <eryn@erynwels.me>
|
||||
|
||||
'''
|
||||
Implements an abstract Room class, and subclasses that implement it. Rooms are basic components of maps.
|
||||
'''
|
||||
|
||||
from ..geometry import Point, Rect
|
||||
|
||||
|
||||
class Room:
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
# Eryn Wells <eryn@erynwells.me>
|
||||
|
||||
'''
|
||||
Map tiles and tile related things.
|
||||
|
||||
Maps are represented with 2-dimensional numpy arrays with the `dtype`s defined
|
||||
here. Tiles are instances of those dtypes.
|
||||
'''
|
||||
|
||||
from typing import Tuple
|
||||
|
||||
import numpy as np
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue