Skip to content

Commit

Permalink
[config] Sequences are replaced with 3-tuples
Browse files Browse the repository at this point in the history
  • Loading branch information
Prometheus3375 committed Jul 19, 2024
1 parent 14fdb6d commit 7ede93b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions solve/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import tomllib
from collections.abc import Sequence
from dataclasses import dataclass

from .key_sets import *
Expand Down Expand Up @@ -27,9 +26,9 @@

@dataclass(frozen=True, kw_only=True, slots=True)
class Config:
inner_shapes: Sequence[Shape2D]
held_shapes: Sequence[Shape3D]
players: Sequence[Player]
inner_shapes: tuple[Shape2D, Shape2D, Shape2D]
held_shapes: tuple[Shape3D, Shape3D, Shape3D]
players: tuple[Player, Player, Player]
is_doing_triumph: bool
last_position: PositionsType | None

Expand Down Expand Up @@ -102,9 +101,9 @@ def read_config(filepath: str, /) -> Config:
players.append(Player(**p))

return Config(
inner_shapes=inner,
held_shapes=held,
players=players,
inner_shapes=(inner[0], inner[1], inner[2]),
held_shapes=(held[0], held[1], held[2]),
players=(players[0], players[1], players[2]),
is_doing_triumph=is_doing_triumph,
last_position=last_position,
)
Expand Down

0 comments on commit 7ede93b

Please sign in to comment.