Small bit of reformatting and type checking
This commit is contained in:
parent
885868f39e
commit
21c3b5d94f
2 changed files with 10 additions and 3 deletions
|
@ -1,4 +1,6 @@
|
||||||
from typing import List
|
# Eryn Wells <eryn@erynwells.me>
|
||||||
|
|
||||||
|
from typing import List, TYPE_CHECKING
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
|
@ -6,6 +8,9 @@ from .corridor import CorridorGenerator
|
||||||
from .room import RoomGenerator
|
from .room import RoomGenerator
|
||||||
from ...geometry import Point
|
from ...geometry import Point
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from .. import Map
|
||||||
|
|
||||||
|
|
||||||
class MapGenerator:
|
class MapGenerator:
|
||||||
'''Abstract base class defining an interface for generating a map and applying it to a set of tiles.'''
|
'''Abstract base class defining an interface for generating a map and applying it to a set of tiles.'''
|
||||||
|
|
|
@ -41,8 +41,10 @@ class RoomGenerator:
|
||||||
'''Generate rooms and stairs'''
|
'''Generate rooms and stairs'''
|
||||||
did_generate_rooms = self._generate()
|
did_generate_rooms = self._generate()
|
||||||
|
|
||||||
if did_generate_rooms:
|
if not did_generate_rooms:
|
||||||
self._generate_stairs()
|
return
|
||||||
|
|
||||||
|
self._generate_stairs()
|
||||||
|
|
||||||
def _generate(self) -> bool:
|
def _generate(self) -> bool:
|
||||||
'''
|
'''
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue