Fill: Improve clarity of remaining_fill messages (#2894)
* Update Fill.py Make the fill message more descriptive * Removing kwarg
This commit is contained in:
parent
c6b1039e0f
commit
862d77820d
9
Fill.py
9
Fill.py
|
@ -208,7 +208,8 @@ def fill_restrictive(multiworld: MultiWorld, base_state: CollectionState, locati
|
||||||
|
|
||||||
def remaining_fill(multiworld: MultiWorld,
|
def remaining_fill(multiworld: MultiWorld,
|
||||||
locations: typing.List[Location],
|
locations: typing.List[Location],
|
||||||
itempool: typing.List[Item]) -> None:
|
itempool: typing.List[Item],
|
||||||
|
name: str = "Remaining") -> None:
|
||||||
unplaced_items: typing.List[Item] = []
|
unplaced_items: typing.List[Item] = []
|
||||||
placements: typing.List[Location] = []
|
placements: typing.List[Location] = []
|
||||||
swapped_items: typing.Counter[typing.Tuple[int, str]] = Counter()
|
swapped_items: typing.Counter[typing.Tuple[int, str]] = Counter()
|
||||||
|
@ -265,10 +266,10 @@ def remaining_fill(multiworld: MultiWorld,
|
||||||
placements.append(spot_to_fill)
|
placements.append(spot_to_fill)
|
||||||
placed += 1
|
placed += 1
|
||||||
if not placed % 1000:
|
if not placed % 1000:
|
||||||
_log_fill_progress("Remaining", placed, total)
|
_log_fill_progress(name, placed, total)
|
||||||
|
|
||||||
if total > 1000:
|
if total > 1000:
|
||||||
_log_fill_progress("Remaining", placed, total)
|
_log_fill_progress(name, placed, total)
|
||||||
|
|
||||||
if unplaced_items and locations:
|
if unplaced_items and locations:
|
||||||
# There are leftover unplaceable items and locations that won't accept them
|
# There are leftover unplaceable items and locations that won't accept them
|
||||||
|
@ -466,7 +467,7 @@ def distribute_items_restrictive(multiworld: MultiWorld) -> None:
|
||||||
|
|
||||||
inaccessible_location_rules(multiworld, multiworld.state, defaultlocations)
|
inaccessible_location_rules(multiworld, multiworld.state, defaultlocations)
|
||||||
|
|
||||||
remaining_fill(multiworld, excludedlocations, filleritempool)
|
remaining_fill(multiworld, excludedlocations, filleritempool, "Remaining Excluded")
|
||||||
if excludedlocations:
|
if excludedlocations:
|
||||||
raise FillError(
|
raise FillError(
|
||||||
f"Not enough filler items for excluded locations. There are {len(excludedlocations)} more locations than items")
|
f"Not enough filler items for excluded locations. There are {len(excludedlocations)} more locations than items")
|
||||||
|
|
Loading…
Reference in New Issue