Pass the whole Map into MapGenerator.generate
This commit is contained in:
parent
7428d95126
commit
37ffa423b6
3 changed files with 27 additions and 16 deletions
|
@ -12,7 +12,7 @@ import numpy as np
|
|||
import numpy.typing as npt
|
||||
import tcod
|
||||
|
||||
from ..engine import Configuration
|
||||
from ..configuration import Configuration
|
||||
from ..geometry import Point, Rect, Size
|
||||
from .generator import MapGenerator
|
||||
from .tile import Empty, Shroud
|
||||
|
@ -28,7 +28,6 @@ class Map:
|
|||
shape = map_size.numpy_shape
|
||||
|
||||
self.tiles = np.full(shape, fill_value=Empty, order='F')
|
||||
generator.generate(self.tiles)
|
||||
|
||||
self.up_stairs = generator.up_stairs
|
||||
self.down_stairs = generator.down_stairs
|
||||
|
@ -42,6 +41,8 @@ class Map:
|
|||
|
||||
self.__walkable_points = None
|
||||
|
||||
generator.generate(self)
|
||||
|
||||
@property
|
||||
def bounds(self) -> Rect:
|
||||
'''The bounds of the map'''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue