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
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -6,6 +8,9 @@ from .corridor import CorridorGenerator
 | 
			
		|||
from .room import RoomGenerator
 | 
			
		||||
from ...geometry import Point
 | 
			
		||||
 | 
			
		||||
if TYPE_CHECKING:
 | 
			
		||||
    from .. import Map
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class MapGenerator:
 | 
			
		||||
    '''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'''
 | 
			
		||||
        did_generate_rooms = self._generate()
 | 
			
		||||
 | 
			
		||||
        if did_generate_rooms:
 | 
			
		||||
            self._generate_stairs()
 | 
			
		||||
        if not did_generate_rooms:
 | 
			
		||||
            return
 | 
			
		||||
 | 
			
		||||
        self._generate_stairs()
 | 
			
		||||
 | 
			
		||||
    def _generate(self) -> bool:
 | 
			
		||||
        '''
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue