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

@@ -396,7 +396,7 @@ def roll_meta_option(option_key, game: str, category_dict: Dict) -> Any:
return get_choice(option_key, category_dict)
if game in AutoWorldRegister.world_types:
game_world = AutoWorldRegister.world_types[game]
options = ChainMap(game_world.options, Options.per_game_common_options)
options = ChainMap(game_world.option_definitions, Options.per_game_common_options)
if option_key in options:
if options[option_key].supports_weighting:
return get_choice(option_key, category_dict)
@@ -557,7 +557,7 @@ def roll_settings(weights: dict, plando_options: PlandoSettings = PlandoSettings
setattr(ret, option_key, option.from_any(get_choice(option_key, weights, option.default)))
if ret.game in AutoWorldRegister.world_types:
for option_key, option in world_type.options.items():
for option_key, option in world_type.option_definitions.items():
handle_option(ret, game_weights, option_key, option)
for option_key, option in Options.per_game_common_options.items():
# skip setting this option if already set from common_options, defaulting to root option