From 0309a7e8b43eedffc65020d6f8960646851d538d Mon Sep 17 00:00:00 2001 From: Prometheus3375 <35541026+Prometheus3375@users.noreply.github.com> Date: Thu, 18 Jul 2024 08:47:47 +0300 Subject: [PATCH] [players] Init function accepts key set --- solve/players.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/solve/players.py b/solve/players.py index 112de5d..c4e684e 100644 --- a/solve/players.py +++ b/solve/players.py @@ -1,8 +1,9 @@ from collections.abc import Mapping, Sequence from dataclasses import dataclass -from solve.shapes import Shape2D -from solve.states import LEFT, MIDDLE, PositionsType, RIGHT, StateOfAllRooms, init_rooms +from .key_sets import KeySetType +from .shapes import Shape2D +from .states import LEFT, MIDDLE, PositionsType, RIGHT, StateOfAllRooms, init_rooms @dataclass(frozen=True, kw_only=True, slots=True) @@ -18,10 +19,13 @@ class Player: def init_rooms_from_players( players: Sequence[Player], inner_shapes: Sequence[Shape2D], + key_set: KeySetType, /, ) -> tuple[StateOfAllRooms, AliasMappingType]: """ - Takes three players in solo rooms and 2D shapes of statues there in order from left to right. + Takes three players in solo rooms, + 2D shapes of statues there in order from left to right, + and the current key set. Returns initial state of solo rooms a mapping of positions to player aliases. """ assert len(players) == len(inner_shapes) == 3, f'number of players and shapes must be 3' @@ -40,6 +44,7 @@ def init_rooms_from_players( middle_other_shape=other[1], right_inner_shape=inner_shapes[2], right_other_shape=other[2], + key_set=key_set, ) return state, aliases