Core: add generic interface to add ER data to hints (#1014)

This commit is contained in:
Fabian Dill
2022-09-18 14:30:43 +02:00
committed by GitHub
parent 58f66e0f42
commit c2d69cb05e
5 changed files with 52 additions and 35 deletions

View File

@@ -955,6 +955,13 @@ class Region:
return True
return False
def get_connecting_entrance(self, is_main_entrance: typing.Callable[[Entrance], bool]) -> Entrance:
for entrance in self.entrances:
if is_main_entrance(entrance):
return entrance
for entrance in self.entrances: # BFS might be better here, trying DFS for now.
return entrance.parent_region.get_connecting_entrance(is_main_entrance)
def __repr__(self):
return self.__str__()