LttP: move game specific fill to new AutoWorld fill_hook

This commit is contained in:
Fabian Dill
2021-08-10 09:03:44 +02:00
parent 299036ecca
commit 9ec0680ce5
6 changed files with 111 additions and 100 deletions

View File

@@ -1,7 +1,7 @@
from __future__ import annotations
from typing import Dict, Set, Tuple
from typing import Dict, Set, Tuple, List
from BaseClasses import MultiWorld, Item, CollectionState
from BaseClasses import MultiWorld, Item, CollectionState, Location
class AutoWorldRegister(type):
@@ -126,6 +126,12 @@ class World(metaclass=AutoWorldRegister):
"""Optional method that is supposed to be used for special fill stages. This is run *after* plando."""
pass
def fill_hook(cls, progitempool: List[Item], nonexcludeditempool: List[Item],
localrestitempool: Dict[int, List[Item]], restitempool: List[Item], fill_locations: List[Location]):
"""Special method that gets called as part of distribute_items_restrictive (main fill).
This gets called once per present world type."""
pass
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."""