How asiercl/monopoly works
Main Components
• Entry Point & Game Controller: At the heart of the application is the main class (MonopolyETSE) which serves as the entry point. Include a “Game Controller” or “Game Engine” node that manages game initialization and the main game loop.
• Game Core Model (Juego and Tablero): These classes manage key game logistics, including turn-taking, state management, and the game board representation.
• Board & Casillas (Squares): Under the “monopoly” package, the “casillas” folder organizes the different types of board squares:
– Acciones: Represents action squares (community and chance),
– Especiales: Special squares like Jail (Carcel, IrCarcel), Parking, and Salida,
– Impuesto: Tax squares,
– Propiedades: Properties, which are further classified by type (Propiedad, Servicio, Solar, Transporte).
• Edificios (Buildings): Represents buildings that can be constructed (Casa, Hotel, Piscina, Pista) which likely interact with property management.
• Partida (Gameplay Components): Contains classes that model the gameplay session:
– Jugador: Represents a player,
– Dado: The dice logic,
– Avatares: Visual or logical representation of player tokens (e.g., Coche, Pelota, Sombrero).
– Tratos: Represents trading functionality between players.
– Cartas: Represents cards (Carta, CartaCajaComunidad, CartaSuerte) and the deck (Baraja).
• Exceptions: A robust exception hierarchy is used to handle game-specific errors (e.g., DineroInsuficiente, JuegoException). Represent this as a separate “Error Handling” component.
• Interfaces: Provide abstraction layers (e.g., Consola, Comando, ConsolaNormal) for user input and output in the terminal – link these to how commands are processed by the game engine.
Relationships and Interactions
• The Game Controller (MonopolyETSE) initializes the game and invokes methods on the Juego and Tablero classes.
• Tablero uses various Casilla objects, each belonging to a different subclass or category (Acciones, Especiales, Propiedades, etc.), demonstrating a factory or polymorphic design pattern.
• The Partida module maintains player state, avatar selections, and game transactions, interacting with the game board and command interfaces.
• Interfaces (Consola/Comando) act as a bridge between user input (terminal commands) and the underlying game logic.
• The exceptions are thrown by many of these modules to enforce game rules and indicate errors.
Architectural Patterns and Design Principles
• Object-Oriented Design: Emphasize inheritance, encapsulation, and polymorphism used extensively in modeling board squares (casillas) and buildings.
• Separation of Concerns: Distinguish between game management (Juego, MonopolyETSE), board representation (Tablero, Casillas), session state (Partida), and UI/command handling (Interfaces).
◦ Under “Board”, create nodes for “Casillas” with branches for “Acciones”, “Especiales”, “Propiedades”, and “Impuesto”.
◦ A separate cluster for “Gameplay Session (Partida)” including sub-nodes “Jugador”, “Dado”, “Avatares”, “Tratos”, and “Cartas”.
◦ A utility cluster for “Edificios”.
Final Recommendations
• Be as detailed as possible: add all major classes and indicate the package structures if space allows.
• Every component node is clearly labeled and grouped by its module.
• Keep in mind the traditional object-oriented structure emphasized by the project – its use of inheritance (with casillas and buildings) and interface abstraction.