# dam-dad/gonzacker architecture

> Architecture diagram of the GitHub repository dam-dad/gonzacker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dam-dad/gonzacker
- Repository: https://github.com/dam-dad/gonzacker

## Overview

##### Main Components
- Application Entry Point & Core: Represent the main application classes (GonzackerApp.java and Main.java) that bootstrap the game.
- Game Components & Models: Include components like CartaPequeniaComponent, EnemyEntity, UserEntity, and models such as Carta, Deck, EfectoCarta, LogicaCarta, Tipos. These handle the game’s data and logic.

##### Relationships and Interactions
- Link Controllers to Models and Game Components, indicating that these controllers receive user inputs (e.g., when a card is played or a node is selected) and then update game state based on the underlying models.
- Enemy logic components (intenciones and patrones) to the combat controller to show how enemy decisions are integrated during combat.
- Separation between user-driven actions (via UI/Controllers) and the underlying business logic (models, deck management, card effects) that drives game progression.

##### Architectural Patterns
- MVC/MVP-style: Controllers act as the mediator between the view (FXML, CSS) and the models.
- Modular Separation: Game logic, enemy behavior, and UI are clearly separated into distinct packages.
- Use of Maven: Although more of a build tool, indicate that project organization and dependency management are handled via Maven (pom.xml).

##### Incorporate Specific Technologies and Frameworks
- Java as the programming language.
- FXML and CSS for constructing the UI.
- Maven for dependency and build management.
- Additional libraries (if any are mentioned in the pom.xml or inferred from the project structure).

##### Final Touches
- Validate that you’ve represented the essential aspects described in the README such as the various game nodes (combat, event, tienda, reparación) by associating them with the relevant controllers and views.
- That the design captures both the user interaction flow (from the UI to the backend) and the internal game logic (models, enemy AI) that drives the gameplay.

## Diagram (Mermaid)

```mermaid
flowchart TD
    B1["pom.xml"]:::build
    subgraph "Application Core"
        A1["GonzackerApp.java"]:::core
        A2["Main.java"]:::core
    end
    subgraph "Controllers Layer"
        C1["CombateController"]:::controllers
        C2["EventoController"]:::controllers
        C3["GameOverController"]:::controllers
        C4["MapController"]:::controllers
        C5["MenuController"]:::controllers
        C6["RecompensasContoller"]:::controllers
        C7["SettingsController"]:::controllers
        C8["TiendaController"]:::controllers
        C9["VictoriaController"]:::controllers
    end
    subgraph "UI/Views"
        UI1["FXML Views"]:::ui
        UI2["CSS Assets"]:::ui
        UI3["Images"]:::ui
    end
    subgraph "Game Models & Components"
        M1["Game Components"]:::models
        M2["Game Models"]:::models
    end
    subgraph "Enemy AI"
        E1["Enemy Intentions"]:::enemy
        E2["Enemy Patterns"]:::enemy
    end

    %% Relationships
    B1 -->|"builds"| A1
    B1 -->|"builds"| A2
    A1 -->|"bootstraps"| C5
    A2 -->|"bootstraps"| C5
    C5 -->|"handles"| UI1
    UI1 -->|"triggers"| C2
    C1 -->|"updates"| M1
    C1 -->|"updates"| M2
    M1 -->|"stateUpdate"| UI1
    M2 -->|"stateUpdate"| UI1
    E1 -->|"influences"| C1
    E2 -->|"influences"| C1

    %% Styles
    classDef core fill:#ADD8E6,stroke:#000,stroke-width:1px;
    classDef controllers fill:#90EE90,stroke:#000,stroke-width:1px;
    classDef ui fill:#FFB6C1,stroke:#000,stroke-width:1px;
    classDef models fill:#FFFFE0,stroke:#000,stroke-width:1px;
    classDef enemy fill:#FFA500,stroke:#000,stroke-width:1px;
    classDef build fill:#D3D3D3,stroke:#000,stroke-width:1px;

    %% Click Events
    click A1 "https://github.com/dam-dad/gonzacker/blob/main/src/main/java/dad/gonzacker/GonzackerApp.java"
    click A2 "https://github.com/dam-dad/gonzacker/blob/main/src/main/java/dad/gonzacker/Main.java"
    click C1 "https://github.com/dam-dad/gonzacker/blob/main/src/main/java/dad/gonzacker/controllers/CombateController.java"
    click C2 "https://github.com/dam-dad/gonzacker/blob/main/src/main/java/dad/gonzacker/controllers/EventoController.java"
    click C3 "https://github.com/dam-dad/gonzacker/blob/main/src/main/java/dad/gonzacker/controllers/GameOverController.java"
    click C4 "https://github.com/dam-dad/gonzacker/blob/main/src/main/java/dad/gonzacker/controllers/MapController.java"
    click C5 "https://github.com/dam-dad/gonzacker/blob/main/src/main/java/dad/gonzacker/controllers/MenuController.java"
    click C6 "https://github.com/dam-dad/gonzacker/blob/main/src/main/java/dad/gonzacker/controllers/RecompensasContoller.java"
    click C7 "https://github.com/dam-dad/gonzacker/blob/main/src/main/java/dad/gonzacker/controllers/SettingsController.java"
    click C8 "https://github.com/dam-dad/gonzacker/blob/main/src/main/java/dad/gonzacker/controllers/TiendaController.java"
    click C9 "https://github.com/dam-dad/gonzacker/blob/main/src/main/java/dad/gonzacker/controllers/VictoriaController.java"
    click UI1 "https://github.com/dam-dad/gonzacker/tree/main/src/main/resources/fxml"
    click UI2 "https://github.com/dam-dad/gonzacker/tree/main/src/main/resources/css"
    click UI3 "https://github.com/dam-dad/gonzacker/tree/main/src/main/resources/images"
    click M1 "https://github.com/dam-dad/gonzacker/tree/main/src/main/java/dad/gonzacker/components"
    click M2 "https://github.com/dam-dad/gonzacker/tree/main/src/main/java/dad/gonzacker/models"
    click E1 "https://github.com/dam-dad/gonzacker/tree/main/src/main/java/dad/gonzacker/intencionesEnemigo"
    click E2 "https://github.com/dam-dad/gonzacker/tree/main/src/main/java/dad/gonzacker/patronesEnemigo"
    click B1 "https://github.com/dam-dad/gonzacker/blob/main/pom.xml"
```
