Skip to content

Commit

Permalink
[states.rooms] Remove obsolete function
Browse files Browse the repository at this point in the history
  • Loading branch information
Prometheus3375 committed Jul 19, 2024
1 parent 8333dda commit 12e9e93
Showing 1 changed file with 1 addition and 35 deletions.
36 changes: 1 addition & 35 deletions solve/states/rooms.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,38 +165,4 @@ def init_rooms(
)


def init_rooms_from_players(
players: Sequence[Player],
inner_shapes: Sequence[Shape2D],
key_set: KeySetType,
/,
) -> tuple[StateOfAllRooms, AliasMappingType]:
"""
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'
inner2person = {
i: p
for i in inner_shapes
for p in players
if p.their_shape == i
}
aliases = dict(zip(ALL_POSITIONS, (inner2person[i].alias for i in inner_shapes)))
other = tuple(inner2person[i].other_shape for i in inner_shapes)
state = init_rooms(
left_inner_shape=inner_shapes[0],
left_other_shape=other[0],
middle_inner_shape=inner_shapes[1],
middle_other_shape=other[1],
right_inner_shape=inner_shapes[2],
right_other_shape=other[2],
key_set=key_set,
)

return state, aliases


__all__ = 'PassMove', 'StateOfAllRooms', 'init_rooms', 'init_rooms_from_players'
__all__ = 'PassMove', 'StateOfAllRooms', 'init_rooms'

0 comments on commit 12e9e93

Please sign in to comment.