games.fox_and_geese.ui¶

Rich UI module for Fox and Geese game visualization.

This module provides rich console UI components for visualizing the Fox and Geese game.

Classes¶

FoxAndGeeseUI

Rich UI for Fox and Geese game visualization.

Module Contents¶

class games.fox_and_geese.ui.FoxAndGeeseUI(console=None)¶

Rich UI for Fox and Geese game visualization.

Initialize the UI.

Parameters:

console (rich.console.Console | None) – Optional Rich console instance

create_analysis_panel(game_state)¶

Create a panel showing the latest analysis.

Parameters:

game_state (haive.games.fox_and_geese.state.FoxAndGeeseState) – Current game state

Returns:

Rich panel with analysis info

Return type:

rich.panel.Panel

create_board_table(game_state)¶

Create a rich visual representation of the board.

Parameters:

game_state (haive.games.fox_and_geese.state.FoxAndGeeseState) – Current game state

Returns:

Rich table representing the board

Return type:

rich.table.Table

create_game_info_panel(game_state)¶

Create a panel with game information.

Parameters:

game_state (haive.games.fox_and_geese.state.FoxAndGeeseState) – Current game state

Returns:

Rich panel with game info

Return type:

rich.panel.Panel

create_last_move_panel(game_state)¶

Create a panel showing the last move.

Parameters:

game_state (haive.games.fox_and_geese.state.FoxAndGeeseState) – Current game state

Returns:

Rich panel with last move info

Return type:

rich.panel.Panel

create_layout(game_state)¶

Create the complete rich UI layout.

Parameters:

game_state (haive.games.fox_and_geese.state.FoxAndGeeseState) – Current game state

Returns:

Complete rich layout

Return type:

rich.layout.Layout

display_final_results(final_state)¶

Display final game results.

Parameters:

final_state (Any) – Final game state

Return type:

None

display_state(state_data)¶

Display the game state using rich UI.

Parameters:

state_data (Any) – State data in various formats

Returns:

True if display was successful, False otherwise

Return type:

bool

display_welcome()¶

Display welcome message.

Return type:

None

extract_game_state(state_data)¶

Extract FoxAndGeeseState from various input formats.

Parameters:

state_data (Any) – State data in various formats

Returns:

FoxAndGeeseState instance or None if extraction fails

Return type:

haive.games.fox_and_geese.state.FoxAndGeeseState | None

print_debug_info(state_data, context='')¶

Print debug information about the state.

Parameters:
  • state_data (Any) – State data to debug

  • context (str) – Context string for debugging

Return type:

None