# pauljackways/goblingauntlet architecture

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

- Interactive diagram: https://gitdiagram.com/pauljackways/goblingauntlet
- Repository: https://github.com/pauljackways/goblingauntlet

## Overview

##### Main Components

a) Presentation Layer (GUI):
- FXML Views (represented by the multiple .fxml files)
- Controllers (all the *Controller.java classes)
- FXWindow and FXWrapper as window management components

b) Core Game Logic:
- Game Entities (Player.java, Tower.java)
- Game Items (Item.java, Buyable.java, Sellable.java)
- Game State (Round.java)
- Enums (EnumGamechangers.java, EnumItems.java, EnumResources.java)

c) Services Layer:
- CounterService

d) Models Layer:
- Counter

e) Resources:
- CSS Styles
- Images
- FXML Layouts

##### Component Relationships

- GUI Layer → Game Core (Controllers interact with game entities)
- GUI Layer → Services (Controllers use services)
- Services → Models (Services manipulate models)
- GUI Layer ↔ Resources (GUI uses CSS and FXML resources)

##### Architectural Pattern Representation

The project follows an MVC-like pattern:
- Model: Game Core + Models
- View: FXML files
- Controller: Controller classes in the GUI package

##### Additional Elements

A section showing:
- Build System (Gradle)
- Test Components (unit tests package)

##### Important Notes

- Clear separation between the JavaFX/FXML-based UI and the game logic
- Controller pattern used for different screens
- Resource management for FXML, CSS, and images
- Relationship between game entities (Player, Tower, Items)
- Test coverage indication

This will provide a comprehensive view of the application's architecture while maintaining clarity about the game's structure and component interactions.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef gui fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef service fill:#f1c40f,stroke:#f39c12,color:black
    classDef model fill:#e67e22,stroke:#d35400,color:white
    classDef resource fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef test fill:#9b59b6,stroke:#8e44ad,color:white

    %% Main Application
    App["App.java"]:::gui
    click App "https://github.com/pauljackways/GoblinGauntlet/blob/main/src/main/java/seng201/team131/App.java"

    %% GUI Layer
    subgraph GUI
        FXWindow["FXWindow"]:::gui
        FXWrapper["FXWrapper"]:::gui
        Controllers["Controllers"]:::gui
        FXMLViews["FXML Views"]:::gui

        click FXWindow "https://github.com/pauljackways/GoblinGauntlet/blob/main/src/main/java/seng201/team131/gui/FXWindow.java"
        click FXWrapper "https://github.com/pauljackways/GoblinGauntlet/blob/main/src/main/java/seng201/team131/gui/FXWrapper.java"
        click Controllers "https://github.com/pauljackways/GoblinGauntlet/tree/main/src/main/java/seng201/team131/gui/"
        click FXMLViews "https://github.com/pauljackways/GoblinGauntlet/tree/main/src/main/resources/fxml/"
    end

    %% Game Core
    subgraph Core
        Entities["Game Entities"]:::core
        Items["Game Items"]:::core
        GameState["Game State"]:::core
        GameEnums["Game Enums"]:::core

        click Entities "https://github.com/pauljackways/GoblinGauntlet/blob/main/src/main/java/seng201/team131/Player.java"
        click Items "https://github.com/pauljackways/GoblinGauntlet/blob/main/src/main/java/seng201/team131/Item.java"
        click GameState "https://github.com/pauljackways/GoblinGauntlet/blob/main/src/main/java/seng201/team131/Round.java"
        click GameEnums "https://github.com/pauljackways/GoblinGauntlet/blob/main/src/main/java/seng201/team131/EnumGamechangers.java"
    end

    %% Services Layer
    subgraph Services
        CounterService["CounterService"]:::service
        click CounterService "https://github.com/pauljackways/GoblinGauntlet/blob/main/src/main/java/seng201/team131/services/CounterService.java"
    end

    %% Models Layer
    subgraph Models
        Counter["Counter"]:::model
        click Counter "https://github.com/pauljackways/GoblinGauntlet/blob/main/src/main/java/seng201/team131/models/Counter.java"
    end

    %% Resources
    subgraph Resources
        CSS["CSS Styles"]:::resource
        Images["Images"]:::resource
        Layouts["FXML Layouts"]:::resource

        click CSS "https://github.com/pauljackways/GoblinGauntlet/blob/main/src/main/resources/css/css.css"
        click Images "https://github.com/pauljackways/GoblinGauntlet/tree/main/src/main/resources/images/"
        click Layouts "https://github.com/pauljackways/GoblinGauntlet/tree/main/src/main/resources/fxml/"
    end

    %% Tests
    subgraph Tests
        ServiceTests["Service Tests"]:::test
        click ServiceTests "https://github.com/pauljackways/GoblinGauntlet/blob/main/src/test/java/seng201/team131/unittests/services/CounterServiceTest.java"
    end

    %% Relationships
    App --> GUI
    GUI --> Core
    GUI --> Services
    GUI --> Resources
    Services --> Models
    ServiceTests -.-> Services

    %% Legend
    subgraph Legend
        L1["GUI Components"]:::gui
        L2["Core Game Logic"]:::core
        L3["Services"]:::service
        L4["Models"]:::model
        L5["Resources"]:::resource
        L6["Tests"]:::test
    end
```
