Core: convert item name groups to frozenset

Some worlds define them in lists, this speeds up lookup via state.has_group() or similar
This commit is contained in:
Fabian Dill 2022-08-23 23:33:30 +02:00 committed by Fabian Dill
parent 1aaf89ff2c
commit 0d6cbd9093
1 changed files with 2 additions and 1 deletions

View File

@ -27,7 +27,8 @@ class AutoWorldRegister(type):
# build rest
dct["item_names"] = frozenset(dct["item_name_to_id"])
dct["item_name_groups"] = dct.get("item_name_groups", {})
dct["item_name_groups"] = {group_name: frozenset(group_set) for group_name, group_set
in dct.get("item_name_groups", {}).items()}
dct["item_name_groups"]["Everything"] = dct["item_names"]
dct["location_names"] = frozenset(dct["location_name_to_id"])
dct["all_item_and_group_names"] = frozenset(dct["item_names"] | set(dct.get("item_name_groups", {})))