Core: MultiData typing (#5071)

This commit is contained in:
Doug Hoskisson
2025-07-26 16:27:29 -07:00
committed by GitHub
parent a36e6259f1
commit c9ebf69e0d
7 changed files with 61 additions and 31 deletions

View File

@@ -7,8 +7,9 @@ import warnings
import zipimport
import time
import dataclasses
from typing import Dict, List, TypedDict
from typing import List
from NetUtils import DataPackage
from Utils import local_path, user_path
local_folder = os.path.dirname(__file__)
@@ -24,8 +25,6 @@ __all__ = {
"world_sources",
"local_folder",
"user_folder",
"GamesPackage",
"DataPackage",
"failed_world_loads",
}
@@ -33,18 +32,6 @@ __all__ = {
failed_world_loads: List[str] = []
class GamesPackage(TypedDict, total=False):
item_name_groups: Dict[str, List[str]]
item_name_to_id: Dict[str, int]
location_name_groups: Dict[str, List[str]]
location_name_to_id: Dict[str, int]
checksum: str
class DataPackage(TypedDict):
games: Dict[str, GamesPackage]
@dataclasses.dataclass(order=True)
class WorldSource:
path: str # typically relative path from this module