src.modules.backend.game_history_manager

Game history management for reviewing previous games.

Classes

GameHistoryManager([history_file_path])

Manages loading and processing game history data.

Exceptions

GameHistoryError([message])

Exception raised for game history related errors.

exception src.modules.backend.game_history_manager.GameHistoryError(message='')[source]

Exception raised for game history related errors.

class src.modules.backend.game_history_manager.GameHistoryManager(history_file_path=None)[source]

Manages loading and processing game history data.

__init__(history_file_path=None)[source]
load_game_history()[source]

Load and parse game history from JSON file.

Return type:

List[Dict]

paginate_games(games, page_size=10)[source]

Split games into pages of specified size.

Return type:

List[List[Dict]]

get_game_by_id(game_id)[source]

Find and return a game by its ID.

Return type:

Optional[Dict]

format_game_summary(game)[source]

Format a game for display in the summary table.

Return type:

Dict[str, str]

validate_game_id(game_id)[source]

Validate that a game ID is in the correct format (6 characters).

Return type:

bool