mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Zillion: use "new" settings api and cleaning (#3903)
* Zillion: use "new" settings api and cleaning * python 3.10 typing update * don't separate assignments of item link players
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from collections import Counter
|
||||
from dataclasses import dataclass
|
||||
from typing import ClassVar, Dict, Literal, Tuple, TypeGuard
|
||||
from typing import ClassVar, Literal, TypeGuard
|
||||
|
||||
from Options import Choice, DefaultOnToggle, NamedRange, OptionGroup, PerGameCommonOptions, Range, Removed, Toggle
|
||||
|
||||
@@ -107,7 +107,7 @@ class ZillionStartChar(Choice):
|
||||
display_name = "start character"
|
||||
default = "random"
|
||||
|
||||
_name_capitalization: ClassVar[Dict[int, Chars]] = {
|
||||
_name_capitalization: ClassVar[dict[int, Chars]] = {
|
||||
option_jj: "JJ",
|
||||
option_apple: "Apple",
|
||||
option_champ: "Champ",
|
||||
@@ -263,7 +263,7 @@ class ZillionMapGen(Choice):
|
||||
option_full = 2
|
||||
default = 0
|
||||
|
||||
def zz_value(self) -> Literal['none', 'rooms', 'full']:
|
||||
def zz_value(self) -> Literal["none", "rooms", "full"]:
|
||||
if self.value == ZillionMapGen.option_none:
|
||||
return "none"
|
||||
if self.value == ZillionMapGen.option_rooms:
|
||||
@@ -305,7 +305,7 @@ z_option_groups = [
|
||||
]
|
||||
|
||||
|
||||
def convert_item_counts(ic: "Counter[str]") -> ZzItemCounts:
|
||||
def convert_item_counts(ic: Counter[str]) -> ZzItemCounts:
|
||||
tr: ZzItemCounts = {
|
||||
ID.card: ic["ID Card"],
|
||||
ID.red: ic["Red ID Card"],
|
||||
@@ -319,7 +319,7 @@ def convert_item_counts(ic: "Counter[str]") -> ZzItemCounts:
|
||||
return tr
|
||||
|
||||
|
||||
def validate(options: ZillionOptions) -> "Tuple[ZzOptions, Counter[str]]":
|
||||
def validate(options: ZillionOptions) -> tuple[ZzOptions, Counter[str]]:
|
||||
"""
|
||||
adjusts options to make game completion possible
|
||||
|
||||
|
||||
Reference in New Issue
Block a user