AutoWorld: add post_fill

LttP: Move ShopSlotFill to post_fill
This commit is contained in:
Fabian Dill
2021-08-30 01:16:04 +02:00
parent 7ba4bfc0d5
commit baa7992a7a
4 changed files with 10 additions and 4 deletions

View File

@@ -138,6 +138,9 @@ class World(metaclass=AutoWorldRegister):
This gets called once per present world type."""
pass
def post_fill(self):
"""Optional Method that is called after regular fill. Can be used to do adjustments before output generation."""
def generate_output(self, output_directory: str):
"""This method gets called from a threadpool, do not use world.random here.
If you need any last-second randomization, use MultiWorld.slot_seeds[slot] instead."""

View File

@@ -159,6 +159,7 @@ def ShopSlotFill(world):
shop_slots -= removed
if shop_slots:
logger.info("Filling LttP Shop Slots")
del shop_slots
from Fill import swap_location_item

View File

@@ -229,6 +229,10 @@ class ALTTPWorld(World):
from .Dungeons import fill_dungeons_restrictive
fill_dungeons_restrictive(world)
@classmethod
def stage_post_fill(cls, world):
Shops.ShopSlotFill(world)
def generate_output(self, output_directory: str):
world = self.world
player = self.player