# gdap-2023/prog50016-lab5 architecture

> Architecture diagram of the GitHub repository gdap-2023/prog50016-lab5, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gdap-2023/prog50016-lab5
- Repository: https://github.com/gdap-2023/prog50016-lab5

## Overview

##### Project type and purpose
- This is a native C++ game engine (in Engine/) plus a client game project (in GameProject/) that uses the engine. It relies on SDL (under External-Libs/) for windowing, input, audio and rendering.
- The engine provides core systems (rendering, audio, collision, input, scene management, asset management, etc.). The game (“Taco Warrior Reborn III”) implements gameplay logic (entities like Player, Ghoul, Zombie, scenes like GameOver) by calling into engine APIs.

##### File structure
- Top-level:
- .github, .gitignore, Doxyfile – repository configuration and docs
- Engine/Engine.sln – Visual Studio solution for engine
- External-Libs/SDL – third-party library source + headers + binaries
- GameProject/GameProject.sln – Visual Studio solution for the game
- GameProject/Build/Assets – game asset metadata (JSON) and built assets (.wav.asset)
- Engine/Engine:
- Core engine class (Engine, GameEngine, EngineCore, EngineTime, EngineMath)
- Subsystems: AudioSystem, InputSystem, RenderSystem, CollisionSystem, SceneManager, AssetManager
- Runtime components: Entity, Component, Transform, Renderable, Sprite, AnimatedSprite, BoxCollider/CircleCollider
- Asset classes: Asset, TextureAsset, MusicAsset, SoundAsset, FontAsset
- Utilities: JSON parser, random number generator (mersenne)
- GameProject/GameProject:
- main.cpp – program entry point
- Game_Register.cpp – registers game objects with engine reflection or factory
- GameCore.h – game initialization logic
- Scene classes: GameOver
- Entity implementations: Ghoul, Zombie, Player

##### README for additional insights
- The README is a marketing blurb. It does not document architecture. All architectural hints come from the file tree.

## Diagram (Mermaid)

```mermaid
graph TB
    %% External Library Layer
    subgraph "External Library"
        SDL2["SDL2"]:::external
    end

    %% Engine Layer
    subgraph "Engine"
        subgraph "Core"
            EngineCore["EngineCore"]:::engine
        end
        subgraph "Systems"
            InputSystem["InputSystem"]:::engine
            AudioSystem["AudioSystem"]:::engine
            RenderSystem["RenderSystem"]:::engine
            CollisionSystem["CollisionSystem"]:::engine
            SceneManager["SceneManager"]:::engine
            AssetManager["AssetManager"]:::engine
        end
        subgraph "Entity-Component"
            Entity["Entity"]:::engine
            Component["Component"]:::engine
            Transform["Transform"]:::engine
        end
        subgraph "Components"
            BoxCollider["BoxCollider"]:::engine
            CircleCollider["CircleCollider"]:::engine
            Renderable["Renderable"]:::engine
            Sprite["Sprite"]:::engine
            AnimatedSprite["AnimatedSprite"]:::engine
        end
        subgraph "Assets"
            Asset["Asset"]:::engine
            TextureAsset["TextureAsset"]:::engine
            SoundAsset["SoundAsset"]:::engine
            MusicAsset["MusicAsset"]:::engine
            FontAsset["FontAsset"]:::engine
        end
        subgraph "Utils"
            JSONParser["JSON Parser"]:::engine
            Random["Random (Mersenne)"]:::engine
        end
        subgraph "Engine Math/Time"
            EngineMath["EngineMath"]:::engine
            EngineTime["EngineTime"]:::engine
        end
    end

    %% Game Project Layer
    subgraph "Game Project"
        Main["main.cpp"]:::game
        GameCore["GameCore"]:::game
        GameRegister["Game_Register.cpp"]:::game
        subgraph "Scenes"
            GameOver["GameOver"]:::game
        end
        subgraph "Entities"
            Player["Player"]:::game
            Ghoul["Ghoul"]:::game
            Zombie["Zombie"]:::game
        end
    end

    %% Data Assets Layer
    AssetsMeta["Asset Metadata (JSON)"]:::data
    SceneData["Scene Data (JSON)"]:::data
    BuiltAssets["Built Assets (.wav.asset)"]:::data

    %% Relationships
    EngineCore -->|"initializes/updates"| InputSystem
    EngineCore -->|"initializes/updates"| AudioSystem
    EngineCore -->|"initializes/updates"| RenderSystem
    EngineCore -->|"initializes/updates"| CollisionSystem
    EngineCore -->|"initializes/updates"| SceneManager
    EngineCore -->|"initializes/updates"| AssetManager
    EngineCore -->|"uses"| EngineMath
    EngineCore -->|"uses"| EngineTime

    InputSystem -->|"calls SDL"| SDL2
    AudioSystem -->|"calls SDL_mixer"| SDL2
    RenderSystem -->|"calls SDL_renderer"| SDL2

    SceneManager -->|"loads scenes via"| AssetManager
    SceneManager -->|"parses JSON via"| JSONParser
    SceneManager -->|"creates entities"| Entity

    AssetManager -->|"parses JSON via"| JSONParser
    AssetManager -->|"provides assets"| TextureAsset
    AssetManager -->|"provides assets"| SoundAsset
    AssetManager -->|"provides assets"| MusicAsset
    AssetManager -->|"provides assets"| FontAsset

    Entity -->|"composed of"| Component
    Component -->|"is a"| Transform
    Component -->|"is a"| Renderable
    Renderable -->|"implemented by"| Sprite
    Renderable -->|"implemented by"| AnimatedSprite
    Component -->|"is a"| BoxCollider
    Component -->|"is a"| CircleCollider

    AssetsMeta -->|"fed into"| AssetManager
    SceneData -->|"fed into"| SceneManager
    BuiltAssets -->|"fed into"| AssetManager

    Main -->|"starts"| GameCore
    GameCore -->|"uses"| EngineCore
    GameCore -->|"registers via"| GameRegister
    GameCore -->|"triggers scene"| SceneManager

    Player -->|"responds via"| InputSystem
    Player -->|"renders via"| RenderSystem
    Player -->|"collides via"| CollisionSystem
    Ghoul -->|"responds via"| InputSystem
    Ghoul -->|"renders via"| RenderSystem
    Ghoul -->|"collides via"| CollisionSystem
    Zombie -->|"responds via"| InputSystem
    Zombie -->|"renders via"| RenderSystem
    Zombie -->|"collides via"| CollisionSystem
    GameOver -->|"managed by"| SceneManager

    %% Click Events for component mapping
    click EngineCore "https://github.com/gdap-2023/prog50016-lab5/blob/main/Engine/Engine/Engine.cpp"
    click InputSystem "https://github.com/gdap-2023/prog50016-lab5/blob/main/Engine/Engine/InputSystem.cpp"
    click AudioSystem "https://github.com/gdap-2023/prog50016-lab5/blob/main/Engine/Engine/AudioSystem.cpp"
    click RenderSystem "https://github.com/gdap-2023/prog50016-lab5/blob/main/Engine/Engine/RenderSystem.cpp"
    click CollisionSystem "https://github.com/gdap-2023/prog50016-lab5/blob/main/Engine/Engine/CollisionSystem.cpp"
    click SceneManager "https://github.com/gdap-2023/prog50016-lab5/blob/main/Engine/Engine/SceneManager.cpp"
    click AssetManager "https://github.com/gdap-2023/prog50016-lab5/blob/main/Engine/Engine/AssetManager.cpp"
    click Entity "https://github.com/gdap-2023/prog50016-lab5/blob/main/Engine/Engine/Entity.cpp"
    click Component "https://github.com/gdap-2023/prog50016-lab5/blob/main/Engine/Engine/Component.cpp"
    click Transform "https://github.com/gdap-2023/prog50016-lab5/blob/main/Engine/Engine/Transform.cpp"
    click BoxCollider "https://github.com/gdap-2023/prog50016-lab5/blob/main/Engine/Engine/BoxCollider.cpp"
    click CircleCollider "https://github.com/gdap-2023/prog50016-lab5/blob/main/Engine/Engine/CircleCollider.cpp"
    click Renderable "https://github.com/gdap-2023/prog50016-lab5/blob/main/Engine/Engine/Renderable.cpp"
    click Sprite "https://github.com/gdap-2023/prog50016-lab5/blob/main/Engine/Engine/Sprite.cpp"
    click AnimatedSprite "https://github.com/gdap-2023/prog50016-lab5/blob/main/Engine/Engine/AnimatedSprite.cpp"
    click TextureAsset "https://github.com/gdap-2023/prog50016-lab5/blob/main/Engine/Engine/TextureAsset.cpp"
    click SoundAsset "https://github.com/gdap-2023/prog50016-lab5/blob/main/Engine/Engine/SoundAsset.cpp"
    click MusicAsset "https://github.com/gdap-2023/prog50016-lab5/blob/main/Engine/Engine/MusicAsset.cpp"
    click FontAsset "https://github.com/gdap-2023/prog50016-lab5/blob/main/Engine/Engine/FontAsset.cpp"
    click JSONParser "https://github.com/gdap-2023/prog50016-lab5/blob/main/Engine/Engine/json.cpp"
    click Random "https://github.com/gdap-2023/prog50016-lab5/blob/main/Engine/Engine/mersenne.cpp"
    click EngineMath "https://github.com/gdap-2023/prog50016-lab5/blob/main/Engine/Engine/EngineMath.cpp"
    click EngineTime "https://github.com/gdap-2023/prog50016-lab5/blob/main/Engine/Engine/EngineTime.cpp"
    click SDL2 "https://github.com/gdap-2023/prog50016-lab5/tree/main/Engine/External-Libs/SDL"

    click Main "https://github.com/gdap-2023/prog50016-lab5/blob/main/GameProject/GameProject/main.cpp"
    click GameCore "https://github.com/gdap-2023/prog50016-lab5/blob/main/GameProject/GameProject/GameCore.h"
    click GameRegister "https://github.com/gdap-2023/prog50016-lab5/blob/main/GameProject/GameProject/Game_Register.cpp"
    click GameOver "https://github.com/gdap-2023/prog50016-lab5/blob/main/GameProject/GameProject/GameOver.cpp"
    click Player "https://github.com/gdap-2023/prog50016-lab5/blob/main/GameProject/GameProject/Player.cpp"
    click Ghoul "https://github.com/gdap-2023/prog50016-lab5/blob/main/GameProject/GameProject/Ghoul.cpp"
    click Zombie "https://github.com/gdap-2023/prog50016-lab5/blob/main/GameProject/GameProject/Zombie.cpp"

    %% Styles
    classDef engine fill:#D6EAF8,stroke:#21618C,color:#1B4F72
    classDef game fill:#FADBD8,stroke:#C0392B,color:#7B241C
    classDef external fill:#E8DAEF,stroke:#6C3483,color:#4A235A
    classDef data fill:#FEF9E7,stroke:#B7950B,color:#7D6608
```
