mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Core: Introduce new Option class NamedRange (#2330)
Co-authored-by: Chris Wilson <chris@legendserver.info> Co-authored-by: Zach Parks <zach@alliware.com>
This commit is contained in:
@@ -4,7 +4,7 @@ from random import random
|
||||
from typing import Dict
|
||||
|
||||
from BaseClasses import ItemClassification, MultiWorld
|
||||
from Options import SpecialRange
|
||||
from Options import NamedRange
|
||||
from . import setup_solo_multiworld, SVTestBase, SVTestCase, allsanity_options_without_mods, allsanity_options_with_mods
|
||||
from .. import StardewItem, items_by_group, Group, StardewValleyWorld
|
||||
from ..locations import locations_by_tag, LocationTags, location_table
|
||||
@@ -42,7 +42,7 @@ def check_no_ginger_island(tester: unittest.TestCase, multiworld: MultiWorld):
|
||||
|
||||
|
||||
def get_option_choices(option) -> Dict[str, int]:
|
||||
if issubclass(option, SpecialRange):
|
||||
if issubclass(option, NamedRange):
|
||||
return option.special_range_names
|
||||
elif option.options:
|
||||
return option.options
|
||||
@@ -53,7 +53,7 @@ class TestGenerateDynamicOptions(SVTestCase):
|
||||
def test_given_special_range_when_generate_then_basic_checks(self):
|
||||
options = StardewValleyWorld.options_dataclass.type_hints
|
||||
for option_name, option in options.items():
|
||||
if not isinstance(option, SpecialRange):
|
||||
if not isinstance(option, NamedRange):
|
||||
continue
|
||||
for value in option.special_range_names:
|
||||
with self.subTest(f"{option_name}: {value}"):
|
||||
@@ -152,7 +152,7 @@ class TestGenerateAllOptionsWithExcludeGingerIsland(SVTestCase):
|
||||
def test_given_special_range_when_generate_exclude_ginger_island(self):
|
||||
options = StardewValleyWorld.options_dataclass.type_hints
|
||||
for option_name, option in options.items():
|
||||
if not isinstance(option, SpecialRange) or option_name == ExcludeGingerIsland.internal_name:
|
||||
if not isinstance(option, NamedRange) or option_name == ExcludeGingerIsland.internal_name:
|
||||
continue
|
||||
for value in option.special_range_names:
|
||||
with self.subTest(f"{option_name}: {value}"):
|
||||
|
||||
Reference in New Issue
Block a user