Core: Refactor Autoworld.options to Autoworld.option_definitions (#906)

* refactor `world.options` -> `world.option_definitions`

* rename world api reference

* missed some self.options
This commit is contained in:
alwaysintreble
2022-08-15 16:46:59 -05:00
committed by GitHub
parent 8484193151
commit 81cf1508e0
39 changed files with 49 additions and 49 deletions

View File

@@ -86,7 +86,7 @@ inside a World object.
Players provide customized settings for their World in the form of yamls.
Those are accessible through `self.world.<option_name>[self.player]`. A dict
of valid options has to be provided in `self.options`. Options are automatically
of valid options has to be provided in `self.option_definitions`. Options are automatically
added to the `World` object for easy access.
### World Options
@@ -252,7 +252,7 @@ to describe it and a `display_name` property for display on the website and in
spoiler logs.
The actual name as used in the yaml is defined in a `dict[str, Option]`, that is
assigned to the world under `self.options`.
assigned to the world under `self.option_definitions`.
Common option types are `Toggle`, `DefaultOnToggle`, `Choice`, `Range`.
For more see `Options.py` in AP's base directory.
@@ -328,7 +328,7 @@ from .Options import mygame_options # import the options dict
class MyGameWorld(World):
#...
options = mygame_options # assign the options dict to the world
option_definitions = mygame_options # assign the options dict to the world
#...
```
@@ -365,7 +365,7 @@ class MyGameLocation(Location): # or from Locations import MyGameLocation
class MyGameWorld(World):
"""Insert description of the world/game here."""
game: str = "My Game" # name of the game/world
options = mygame_options # options the player can set
option_definitions = mygame_options # options the player can set
topology_present: bool = True # show path to required location checks in spoiler
remote_items: bool = False # True if all items come from the server
remote_start_inventory: bool = False # True if start inventory comes from the server