Add a __repr__ for map.RectangularRoom
This commit is contained in:
parent
8b9897f0cc
commit
ed312e985d
1 changed files with 11 additions and 1 deletions
|
@ -111,10 +111,20 @@ class RoomsAndCorridorsGenerator(MapGenerator):
|
|||
|
||||
return tiles
|
||||
|
||||
def generate_tunnel(self, start_room_bounds: Rect, end_room_bounds: Rect):
|
||||
pass
|
||||
|
||||
def __rect_from_bsp_node(self, node: tcod.bsp.BSP) -> Rect:
|
||||
return Rect(Point(node.x, node.y), Size(node.width, node.height))
|
||||
|
||||
|
||||
class RectangularRoom:
|
||||
def __init__(self, bounds: Rect):
|
||||
self.bounds = bounds
|
||||
|
||||
@property
|
||||
def center(self) -> Point:
|
||||
return self.bounds.midpoint
|
||||
return self.bounds.midpoint
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return f'{self.__class__.__name__}({self.bounds})'
|
Loading…
Add table
Add a link
Reference in a new issue