Skip to content

Commit

Permalink
Options: add a DeathLinkMixin dataclass to easily standardize death_l…
Browse files Browse the repository at this point in the history
…ink (#2355)

* Options: add a DeathLinkOption dataclass to easily standardize death_link

* rename to DeathLinkMixin

* Update worlds/messenger/options.py
  • Loading branch information
alwaysintreble authored Mar 3, 2024
1 parent b2f30d5 commit 526eb09
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 5 additions & 0 deletions Options.py
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,11 @@ class PerGameCommonOptions(CommonOptions):
item_links: ItemLinks


@dataclass
class DeathLinkMixin:
death_link: DeathLink


def generate_yaml_templates(target_folder: typing.Union[str, "pathlib.Path"], generate_hidden: bool = True):
import os

Expand Down
6 changes: 2 additions & 4 deletions worlds/messenger/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from schema import And, Optional, Or, Schema

from Options import Accessibility, Choice, DeathLink, DefaultOnToggle, OptionDict, PerGameCommonOptions, Range, \
from Options import Accessibility, Choice, DeathLinkMixin, DefaultOnToggle, OptionDict, PerGameCommonOptions, Range, \
StartInventoryPool, Toggle


Expand Down Expand Up @@ -133,7 +133,7 @@ class PlannedShopPrices(OptionDict):


@dataclass
class MessengerOptions(PerGameCommonOptions):
class MessengerOptions(DeathLinkMixin, PerGameCommonOptions):
accessibility: MessengerAccessibility
start_inventory: StartInventoryPool
logic_level: Logic
Expand All @@ -146,5 +146,3 @@ class MessengerOptions(PerGameCommonOptions):
percent_seals_required: RequiredSeals
shop_price: ShopPrices
shop_price_plan: PlannedShopPrices
death_link: DeathLink

0 comments on commit 526eb09

Please sign in to comment.