haive.games.single_player.flow_free.agent¶

Flow Free game agent implementation.

This module implements the agent for the Flow Free puzzle game, handling move generation, analysis, and game flow.

Classes¶

FlowFreeAgent

Agent for playing Flow Free puzzle game.

Module Contents¶

class haive.games.single_player.flow_free.agent.FlowFreeAgent(config=FlowFreeConfig())[source]¶

Bases: haive.games.single_player.base.SinglePlayerGameAgent

Agent for playing Flow Free puzzle game.

Initialize the Flow Free agent.

Parameters:

config (haive.games.single_player.flow_free.config.FlowFreeConfig) – Configuration for the agent.

extract_move(response)[source]¶

Extract a move from the engine response.

Parameters:

response (Any) – Response from the engine.

Returns:

Extracted FlowFreeMove.

Return type:

haive.games.single_player.flow_free.models.FlowFreeMove

initialize_game(state)[source]¶

Initialize a new Flow Free game.

Parameters:

state (dict[str, Any]) – Initial state.

Returns:

Command with the initialized game state.

Return type:

langgraph.types.Command

prepare_analysis_context(state)[source]¶

Prepare context for position analysis.

Parameters:

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

Returns:

Context for the analysis engine.

Return type:

dict[str, Any]

prepare_move_context(state)[source]¶

Prepare context for move generation.

Parameters:

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

Returns:

Context for the move generation engine.

Return type:

dict[str, Any]

run_game(debug=False)[source]¶

Run a complete Flow Free game.

Parameters:

debug (bool) – Whether to show debug information.

Returns:

Final game state.

Return type:

dict[str, Any]

visualize_state(state)[source]¶

Visualize the current game state.

Parameters:

state (dict[str, Any]) – Current game state.

Return type:

None