Lingo: Pre-compile datafile to improve loading time (#2829)

This commit is contained in:
Star Rauchenberger
2024-03-15 04:26:00 -04:00
committed by GitHub
parent e534abeab0
commit afe7aea536
13 changed files with 626 additions and 515 deletions

View File

@@ -2,7 +2,8 @@ from enum import Flag, auto
from typing import Dict, List, NamedTuple
from BaseClasses import Location
from .static_logic import DOORS_BY_ROOM, PANELS_BY_ROOM, RoomAndPanel, get_door_location_id, get_panel_location_id
from .datatypes import RoomAndPanel
from .static_logic import DOORS_BY_ROOM, PANELS_BY_ROOM, get_door_location_id, get_panel_location_id
class LocationClassification(Flag):
@@ -20,14 +21,6 @@ class LocationData(NamedTuple):
panels: List[RoomAndPanel]
classification: LocationClassification
def panel_ids(self):
ids = set()
for panel in self.panels:
effective_room = self.room if panel.room is None else panel.room
panel_data = PANELS_BY_ROOM[effective_room][panel.panel]
ids = ids | set(panel_data.internal_ids)
return ids
class LingoLocation(Location):
"""