Core: move `OptionGroup` definition to `Options.py` (#3325)
This commit is contained in:
parent
1b6fb7b090
commit
230a9e620b
|
@ -1453,14 +1453,6 @@ class Tutorial(NamedTuple):
|
|||
authors: List[str]
|
||||
|
||||
|
||||
class OptionGroup(NamedTuple):
|
||||
"""Define a grouping of options"""
|
||||
name: str
|
||||
"""Name of the group to categorize this option in for display on the WebHost and in generated YAMLS."""
|
||||
options: List[Type[Options.Option]]
|
||||
"""Options to be in the defined group. """
|
||||
|
||||
|
||||
class PlandoOptions(IntFlag):
|
||||
none = 0b0000
|
||||
items = 0b0001
|
||||
|
|
|
@ -1123,6 +1123,14 @@ class DeathLinkMixin:
|
|||
death_link: DeathLink
|
||||
|
||||
|
||||
class OptionGroup(typing.NamedTuple):
|
||||
"""Define a grouping of options."""
|
||||
name: str
|
||||
"""Name of the group to categorize these options in for display on the WebHost and in generated YAMLS."""
|
||||
options: typing.List[typing.Type[Option[typing.Any]]]
|
||||
"""Options to be in the defined group."""
|
||||
|
||||
|
||||
def generate_yaml_templates(target_folder: typing.Union[str, "pathlib.Path"], generate_hidden: bool = True):
|
||||
import os
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ group.
|
|||
|
||||
```python
|
||||
from worlds.AutoWorld import WebWorld
|
||||
from BaseClasses import OptionGroup
|
||||
from Options import OptionGroup
|
||||
|
||||
class MyWorldWeb(WebWorld):
|
||||
option_groups = [
|
||||
|
|
|
@ -11,11 +11,11 @@ from dataclasses import make_dataclass
|
|||
from typing import (Any, Callable, ClassVar, Dict, FrozenSet, List, Mapping,
|
||||
Optional, Set, TextIO, Tuple, TYPE_CHECKING, Type, Union)
|
||||
|
||||
from Options import ExcludeLocations, ItemLinks, LocalItems, NonLocalItems, PerGameCommonOptions, \
|
||||
PriorityLocations, \
|
||||
StartHints, \
|
||||
StartInventory, StartInventoryPool, StartLocationHints
|
||||
from BaseClasses import CollectionState, OptionGroup
|
||||
from Options import (
|
||||
ExcludeLocations, ItemLinks, LocalItems, NonLocalItems, OptionGroup, PerGameCommonOptions,
|
||||
PriorityLocations, StartHints, StartInventory, StartInventoryPool, StartLocationHints
|
||||
)
|
||||
from BaseClasses import CollectionState
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from BaseClasses import MultiWorld, Item, Location, Tutorial, Region, Entrance
|
||||
|
|
Loading…
Reference in New Issue