Development Mode Module
This module defines the DevelopmentMode class, responsible for handling the game state where a player can manage their owned properties. This includes building houses/hotels, selling buildings, mortgaging/unmortgaging properties, and selling properties back to the bank. It provides both visual feedback on the board (highlighting developable properties) and a dedicated UI panel when a specific property is selected.
High-Level Design
Use Case Diagram
Illustrates the primary actions a player can perform when development mode is active.
State Diagram
Shows the states related to the DevelopmentMode being active and whether a property UI is displayed. Note that this also influences the main Game.state.
Detailed Design
Class Diagram
Details the DevelopmentMode class and its primary interactions.
Activity Diagram: Handling Clicks
Shows the logical flow within the handle_click method.
Sequence Diagrams
Activating Development and Selecting a Property (Human Player)
Shows how a human player enters development mode and selects a property.
Sequence Diagram: Activate and Select Property
Performing an Action (e.g., Build House via UI)
Illustrates the process when a player clicks a button in the development UI.
Sequence Diagram: Build House Action (UI Click)
Checking if AI Can Develop
Shows the sequence for the can_develop_ai check.
Sequence Diagram: can_develop_ai Check
Mortgage/Unmortgage Action (UI Click)
Illustrates handling the mortgage button click in the UI.
Sequence Diagram: Mortgage/Unmortgage Action
Key Classes Overview
DevelopmentMode: Orchestrates the development phase. It activates/deactivates the mode, handles player input (clicks on board/UI, keyboard shortcuts for humans), draws visual cues (stars on properties) and the detailed property management UI panel. It relies heavily on GameLogic to validate actions and update game state, and on GameBoard for visual updates and user messages. It interacts with the main Game object to access shared resources and state like the selected property.