haive.games.single_player.flow_free.models¶

Models for Flow Free gameplay and analysis.

This module defines the core data models for the Flow Free puzzle game, including move representation and strategic analysis.

Classes¶

FlowColor

Color options for Flow Free pipes.

FlowFreeAnalysis

Strategic analysis of a Flow Free board position.

FlowFreeMove

Represents a single move in Flow Free.

PipeDirection

Direction of a pipe segment.

Position

A position on the Flow Free board.

Module Contents¶

class haive.games.single_player.flow_free.models.FlowColor[source]¶

Bases: str, enum.Enum

Color options for Flow Free pipes.

Initialize self. See help(type(self)) for accurate signature.

class haive.games.single_player.flow_free.models.FlowFreeAnalysis(/, **data)[source]¶

Bases: pydantic.BaseModel

Strategic analysis of a Flow Free board position.

Parameters:

data (Any)

completed_flows¶

List of flow IDs that have been completed.

incomplete_flows¶

List of flow IDs that need completion.

critical_flows¶

Flows that are most constrained and should be prioritized.

blocked_flows¶

Flows that might be blocked or have limited space.

recommended_move¶

The suggested next move based on analysis.

reasoning¶

Detailed explanation of the analysis.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

property completion_percentage: float¶

Calculate the percentage of flows completed.

Return type:

float

class haive.games.single_player.flow_free.models.FlowFreeMove(/, **data)[source]¶

Bases: pydantic.BaseModel

Represents a single move in Flow Free.

Parameters:

data (Any)

flow_id¶

Identifier for the flow being extended.

position¶

Position to place the next pipe segment.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

class haive.games.single_player.flow_free.models.PipeDirection[source]¶

Bases: str, enum.Enum

Direction of a pipe segment.

Initialize self. See help(type(self)) for accurate signature.

class haive.games.single_player.flow_free.models.Position(/, **data)[source]¶

Bases: pydantic.BaseModel

A position on the Flow Free board.

Parameters:

data (Any)

row¶

Row index (0-based).

col¶

Column index (0-based).

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.