haive.games.among_us.enhanced_ui ================================ .. py:module:: haive.games.among_us.enhanced_ui .. autoapi-nested-parse:: Enhanced Rich UI module for Among Us game visualization. This module provides an enhanced rich console UI for visualizing the Among Us game, with better styling, animated visualizations, and improved game information display. Classes ------- .. autoapisummary:: haive.games.among_us.enhanced_ui.EnhancedAmongUsUI Module Contents --------------- .. py:class:: EnhancedAmongUsUI(console = None) Enhanced UI for Among Us game with rich terminal graphics. This class provides a visually appealing terminal UI for Among Us games, with styled components, animations, and comprehensive game information. Features: - Beautiful game map visualization with colored squares - Animated transitions between game states - Detailed player status display - Vent and sabotage system visualization - Meeting and voting interfaces - Game over screens with detailed statistics Initialize the UI. :param console: Optional Rich console instance .. py:method:: animate_move(move, state_before, state_after, player_id, delay = 0.5) Animate a move being made. :param move: Move details :param state_before: State before the move :param state_after: State after the move :param player_id: ID of the player making the move :param delay: Delay for animation :returns: None .. py:method:: create_game_info_panel(state) Create a panel with general game information. :param state: Current game state :returns: Rich panel containing game information .. py:method:: create_game_over_panel(state) Create a panel for the game over screen. :param state: Current game state :returns: Rich panel for game over .. py:method:: create_layout(state, player_id = None, legal_moves = None) Create the complete layout for the game UI. :param state: Current game state :param player_id: Optional ID of the current player's perspective :param legal_moves: Optional list of legal moves for the player :returns: Complete rich layout .. py:method:: create_legal_moves_panel(legal_moves) Create a panel showing legal moves. :param legal_moves: List of legal moves for the player :returns: Rich panel showing legal moves .. py:method:: create_map_visualization(state, player_id = None) Create a visual representation of the map with rooms, vents, and players. :param state: Current game state :param player_id: Optional ID of the player whose perspective to show :returns: Rich panel containing the map visualization .. py:method:: create_meeting_panel(state) Create a panel for the meeting phase. :param state: Current game state :returns: Rich panel for the meeting .. py:method:: create_other_players_panel(state, player_id) Create a panel showing information about other players. :param state: Current game state :param player_id: ID of the current player :returns: Rich panel containing other player information .. py:method:: create_player_info_panel(state, player_id) Create a panel with detailed information about the player. :param state: Current game state :param player_id: ID of the player to show info for :returns: Rich panel containing player information .. py:method:: create_sabotage_panel(state, player_id = None) Create a panel showing active sabotage information if any. :param state: Current game state :param player_id: Optional ID of the current player :returns: Rich panel for sabotage or None if no active sabotage .. py:method:: display_final_results(final_state) Display enhanced final game results. :param final_state: Final game state :returns: None .. py:method:: display_state(state_data, player_id = None, legal_moves = None) Display the game state using enhanced rich UI. :param state_data: State data in various formats :param player_id: Optional ID of the player whose perspective to show :param legal_moves: Optional list of legal moves for the player :returns: True if display was successful, False otherwise .. py:method:: display_welcome() Display welcome message and game introduction. :returns: None .. py:method:: extract_game_state(state_data) Extract AmongUsState from various input formats. :param state_data: State data in various formats :returns: AmongUsState instance or None if extraction fails .. py:method:: run_among_us_game(agent, delay = 1.0) Run a complete Among Us game with UI visualization. :param agent: The game agent that manages the game logic :param delay: Delay between game states :returns: Final game state .. py:method:: show_thinking(player_id, message = 'Thinking...') Display a thinking animation for the player. :param player_id: ID of the player who is thinking :param message: Message to display during thinking :returns: None