games.clue.state_manager¶

State manager for the Clue game.

This module defines the state management for the Clue game, providing methods for game logic and state transitions.

Classes¶

ClueStateManager

Manager for Clue game state.

Module Contents¶

class games.clue.state_manager.ClueStateManager¶

Bases: haive.games.framework.base.state_manager.GameStateManager[haive.games.clue.state.ClueState]

Manager for Clue game state.

classmethod add_analysis(state, player, hypothesis)¶

Add a hypothesis to the state.

Parameters:
Returns:

Updated state with added hypothesis

Return type:

haive.games.clue.state.ClueState

classmethod apply_move(state, move)¶

Apply a guess to the current state.

Parameters:
Returns:

Updated game state

Return type:

haive.games.clue.state.ClueState

classmethod check_game_status(state)¶

Check and potentially update game status.

Parameters:

state (haive.games.clue.state.ClueState) – Current game state

Returns:

Updated game state

Return type:

haive.games.clue.state.ClueState

Get all legal moves for the current state.

Parameters:

state (haive.games.clue.state.ClueState) – The current game state

Returns:

List of possible legal guesses

Return type:

list[haive.games.clue.models.ClueGuess]

classmethod get_possible_solutions(state)¶

Get possible solutions based on the current game state.

Parameters:

state (haive.games.clue.state.ClueState) – Current game state

Returns:

Set of possible solutions as (suspect, weapon, room) tuples

Return type:

set[tuple[str, str, str]]

classmethod get_winner(state)¶

Get the winner of the game.

Parameters:

state (haive.games.clue.state.ClueState) – Current game state

Returns:

Winner of the game, or None if ongoing

Return type:

str | None

classmethod initialize(**kwargs)¶

Initialize a new Clue game.

Parameters:

**kwargs – Keyword arguments for game initialization

Returns:

A new Clue game state

Return type:

ClueState