Game Actions Module
The Game Actions module provides a collection of possible actions that players can perform or that occur during the game. It acts as a high-level controller, orchestrating interactions between the player (human or AI), the game state (Game), the core rules (GameLogic), the visual representation (Board, GameRenderer), and other services like sound (Sound_Manager). It translates user input or AI decisions into concrete game state changes.
The Game Actions module is responsible for:
Executing a player’s turn (play_turn), including dice rolling and movement initiation.
Handling the decision process when a player lands on an unowned property (handle_buy_decision).
Initiating property auctions (start_auction).
Managing the options and outcomes for a player in jail (handle_jail_turn).
Processing AI player turns, including purchase and auction decisions (handle_ai_turn).
Handling player bankruptcy (handle_bankruptcy) and voluntary exits (handle_voluntary_exit).
Managing the Free Parking pot (add_to_free_parking, collect_free_parking).
Handling fines (handle_fine_payment).
Delegating checks for game end conditions (check_one_player_remains, check_game_over).
Coordinating with the main game loop for AI turn triggers (check_and_trigger_ai_turn).
Initiating the end-game sequences (end_full_game, end_abridged_game).
Detailed Design
GameActions Class Diagram
Player Turn Flow Activity Diagram
Play Turn Sequence (Human Player, Normal Roll)
Handle Buy Decision Sequence (Player Buys)
Start Auction Sequence