core: clarify usage of classmethods in World class (#1449)

This commit is contained in:
el-u
2023-02-16 00:28:02 +01:00
committed by GitHub
parent b20be3ccec
commit ad4846cedd
13 changed files with 28 additions and 20 deletions

View File

@@ -188,10 +188,11 @@ class World(metaclass=AutoWorldRegister):
# can also be implemented as a classmethod and called "stage_<original_name>",
# in that case the MultiWorld object is passed as an argument and it gets called once for the entire multiworld.
# An example of this can be found in alttp as stage_pre_fill
@classmethod
def assert_generate(cls) -> None:
def stage_assert_generate(cls, multiworld: "MultiWorld") -> None:
"""Checks that a game is capable of generating, usually checks for some base file like a ROM.
Not run for unittests since they don't produce output"""
This gets called once per present world type. Not run for unittests since they don't produce output"""
pass
def generate_early(self) -> None:
@@ -213,14 +214,12 @@ class World(metaclass=AutoWorldRegister):
"""Optional method that is supposed to be used for special fill stages. This is run *after* plando."""
pass
@classmethod
def fill_hook(cls,
def fill_hook(self,
progitempool: List["Item"],
usefulitempool: List["Item"],
filleritempool: List["Item"],
fill_locations: List["Location"]) -> None:
"""Special method that gets called as part of distribute_items_restrictive (main fill).
This gets called once per present world type."""
"""Special method that gets called as part of distribute_items_restrictive (main fill)."""
pass
def post_fill(self) -> None: