Core: use assert correctly (#345)

Core: add some more types to State and add count() method
This commit is contained in:
Fabian Dill
2022-03-26 01:12:54 +01:00
committed by GitHub
parent 902472be32
commit 64ac619b46
6 changed files with 20 additions and 17 deletions

View File

@@ -360,8 +360,8 @@ def main(args, seed=None, baked_server_options: Optional[Dict[str, object]] = No
locations_data: Dict[int, Dict[int, Tuple[int, int, int]]] = {player: {} for player in world.player_ids}
for location in world.get_filled_locations():
if type(location.address) == int:
# item code None should be event, location.address should then also be None
assert location.item.code is not None
assert location.item.code is not None, "item code None should be event, " \
"location.address should then also be None"
locations_data[location.player][location.address] = \
location.item.code, location.item.player, location.item.flags
if location.name in world.start_location_hints[location.player]: