games.single_player.flow_free.state_manager¶

State manager for Flow Free game logic and mechanics.

This module handles game initialization, move validation, and state transitions for the Flow Free puzzle game.

Classes¶

FlowFreeStateManager

Manager for Flow Free game state.

Module Contents¶

class games.single_player.flow_free.state_manager.FlowFreeStateManager¶

Bases: haive.games.single_player.base.SinglePlayerStateManager[haive.games.single_player.flow_free.state.FlowFreeState]

Manager for Flow Free game state.

classmethod apply_move(state, move)¶

Apply a move to the current state.

Parameters:
Returns:

Updated game state.

Raises:

ValueError – If the move is invalid.

Return type:

haive.games.single_player.flow_free.state.FlowFreeState

classmethod check_game_status(state)¶

Check and update the game status.

Parameters:

state (haive.games.single_player.flow_free.state.FlowFreeState) – Current game state.

Returns:

Updated game state with status checked.

Return type:

haive.games.single_player.flow_free.state.FlowFreeState

classmethod generate_hint(state)¶

Generate a hint for the current game state.

Parameters:

state (haive.games.single_player.flow_free.state.FlowFreeState) – Current game state.

Returns:

Tuple of (updated state, hint text).

Return type:

tuple[haive.games.single_player.flow_free.state.FlowFreeState, str]

Get all legal moves for the current state.

Parameters:

state (haive.games.single_player.flow_free.state.FlowFreeState) – Current game state.

Returns:

List of all legal moves.

Return type:

list[haive.games.single_player.flow_free.models.FlowFreeMove]

classmethod initialize(difficulty=GameDifficulty.MEDIUM, player_type=PlayerType.LLM, rows=5, cols=5, num_flows=None, **kwargs)¶

Initialize a new Flow Free game state.

Parameters:
Returns:

A new Flow Free game state.

Return type:

haive.games.single_player.flow_free.state.FlowFreeState

classmethod interactive_input(state, user_input)¶

Process interactive input from the player.

Parameters:
Returns:

Updated game state.

Return type:

haive.games.single_player.flow_free.state.FlowFreeState