haive.games.dominoes.ui¶
Rich UI module for Dominoes game visualization.
This module provides rich console UI components for visualizing the Dominoes game.
Classes¶
Rich UI for Dominoes game visualization. |
Module Contents¶
- class haive.games.dominoes.ui.DominoesUI(console=None)[source]¶
Rich UI for Dominoes game visualization.
Initialize the UI.
- Parameters:
console (rich.console.Console | None) – Optional Rich console instance
- create_analysis_panel(game_state)[source]¶
Create a panel showing the latest analysis.
- Parameters:
game_state (haive.games.dominoes.state.DominoesState) – Current game state
- Returns:
Rich panel with analysis info
- Return type:
rich.panel.Panel
- create_board_panel(game_state)[source]¶
Create a visual representation of the dominoes board.
- Parameters:
game_state (haive.games.dominoes.state.DominoesState) – Current game state
- Returns:
Rich panel representing the board
- Return type:
rich.panel.Panel
- create_game_info_panel(game_state)[source]¶
Create a panel with game information.
- Parameters:
game_state (haive.games.dominoes.state.DominoesState) – Current game state
- Returns:
Rich panel with game info
- Return type:
rich.panel.Panel
- create_last_move_panel(game_state)[source]¶
Create a panel showing the last move.
- Parameters:
game_state (haive.games.dominoes.state.DominoesState) – Current game state
- Returns:
Rich panel with last move info
- Return type:
rich.panel.Panel
- create_layout(game_state)[source]¶
Create the complete rich UI layout.
- Parameters:
game_state (haive.games.dominoes.state.DominoesState) – Current game state
- Returns:
Complete rich layout
- Return type:
rich.layout.Layout
- create_player_hand_panel(game_state, player)[source]¶
Create a panel showing a player’s hand.
- Parameters:
game_state (haive.games.dominoes.state.DominoesState) – Current game state
player (str) – Player whose hand to display
- Returns:
Rich panel with player’s hand
- Return type:
rich.panel.Panel
- display_final_results(final_state)[source]¶
Display final game results.
- Parameters:
final_state (Any) – Final game state
- Return type:
None
- display_state(state_data)[source]¶
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: