How camargo-panqueva/proyecto-final works
Main Components of the System
• Game Logic/Controller Layer:
– Packages under “src/controller” host all the game control logic, including the main launcher, game states and state management, AI players, cell and wall management, and actions.
– Note the “dto” sub-package that encapsulates data transfer objects used for communication between different layers.
• Domain Model Layer:
– The “src/model” directory holds classes representing the core entities of the game such as GameModel, Board, Player (and AI settings), and wall/cell types.
– This layer defines the game’s state, rules, and essential entities.
• Presentation/View Layer:
– The “src/view” folder contains the UI elements, scene management (such as WelcomeScene, PlayingScene, SettingsScene, WinnerScene), game components (like Board, CellRenderer, WallRenderer), and window configuration.
– Input handling is managed in “src/view/input”, which processes keyboard and mouse events.
• Resources & Themes:
– The “src/resources” and “src/view/themes” directories define the aesthetic components like fonts and themes (DarkTheme, LightTheme) for the overall look of the game.
• Utility & Testing Layers:
– Utility functions found in “src/util” serve various helper roles (logging, concurrent loops, timeouts).
– The “test” directory provides unit and integration tests to verify functionality (e.g., saving and loading matches).
Relationships and Interactions
• The Controller then manipulates the Domain Model (e.g., game board, players, walls), managing game state transitions, AI decision-making, and player actions.
• The updated Model state is passed back to the View, where different Scenes (Playing, Settings, Welcome) update to reflect changes.
• DTOs are used to transmit state and response data between components, ensuring that there is a clear demarcation between backend logic and presentation.
• External resources (e.g., themes and fonts) inform the UI’s appearance, while tests verify the correctness of controller operations.
Architectural Patterns and Key Technologies
• MVC Pattern: Separating concerns between control logic, the domain, and the UI.
• Modularization: The project is divided into well-defined sub-packages (cells, wall, state, input, components) that reflect specific responsibilities.
• Use of Java and Canvas library for graphics as indicated by the README.
• The DTO pattern is used to decouple service responses and requests, facilitating maintainability and testability.