Strict and Partial key logic implementations with new test suite utility

This commit is contained in:
aerinon
2023-02-17 10:07:43 -07:00
parent 2b8b9156d9
commit d7c15ae22c
17 changed files with 512 additions and 24 deletions

View File

@@ -20,6 +20,9 @@ class ItemPoolConfig(object):
self.reserved_locations = defaultdict(set)
self.restricted = {}
self.preferred = {}
self.verify = {}
self.verify_count = 0
self.verify_target = 0
self.recorded_choices = []
@@ -435,6 +438,9 @@ def filter_locations(item_to_place, locations, world, vanilla_skip=False, potion
if (item_name, item_to_place.player) in config.preferred:
locs = config.preferred[(item_name, item_to_place.player)]
return sorted(locations, key=lambda l: 0 if l.name in locs else 1)
if (item_name, item_to_place.player) in config.verify:
locs = config.verify[(item_name, item_to_place.player)].keys()
return sorted(locations, key=lambda l: 0 if l.name in locs else 1)
return locations