MultiServer: remove location hinting from !hint and /hint; add /hint_location

This commit is contained in:
Fabian Dill
2022-01-16 02:20:37 +01:00
parent 6a7e1d920a
commit e74333cbd3
2 changed files with 49 additions and 24 deletions

View File

@@ -1,5 +1,5 @@
from __future__ import annotations
from typing import Dict, Set, Tuple, List, Optional, TextIO
from typing import Dict, Set, Tuple, List, Optional, TextIO, Any
from BaseClasses import MultiWorld, Item, CollectionState, Location
from Options import Option
@@ -8,7 +8,7 @@ from Options import Option
class AutoWorldRegister(type):
world_types: Dict[str, World] = {}
def __new__(cls, name, bases, dct):
def __new__(cls, name: str, bases, dct: Dict[str, Any]):
# filter out any events
dct["item_name_to_id"] = {name: id for name, id in dct["item_name_to_id"].items() if id}
dct["location_name_to_id"] = {name: id for name, id in dct["location_name_to_id"].items() if id}
@@ -19,7 +19,7 @@ class AutoWorldRegister(type):
# build rest
dct["item_names"] = frozenset(dct["item_name_to_id"])
dct["location_names"] = frozenset(dct["location_name_to_id"])
dct["all_names"] = dct["item_names"] | dct["location_names"] | set(dct.get("item_name_groups", {}))
dct["all_item_and_group_names"] = frozenset(dct["item_names"] | set(dct.get("item_name_groups", {})))
# construct class
new_class = super().__new__(cls, name, bases, dct)
@@ -71,7 +71,7 @@ class World(metaclass=AutoWorldRegister):
options: Dict[str, type(Option)] = {} # link your Options mapping
game: str # name the game
topology_present: bool = False # indicate if world type has any meaningful layout/pathing
all_names: Set[str] = frozenset() # gets automatically populated with all item, item group and location names
all_item_and_group_names: Set[str] = frozenset() # gets automatically populated with all item and item group names
# map names to their IDs
item_name_to_id: Dict[str, int] = {}