# rudrowo/a-maze architecture

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

- Interactive diagram: https://gitdiagram.com/rudrowo/a-maze
- Repository: https://github.com/rudrowo/a-maze

## Overview

##### Main Components

A. Engine Core Layer
- Components:
- GameLoop (game_loop.cpp)
- Isometry System (isometry.cpp/h)
- Level Parser (level_parser.cpp)
- Menu System (menu.cpp)
- Asset Management (assets.h)

B. Asset Management Layer
- This above the Engine Core
- Include:
- Textures Directory
- Fonts Directory
- Levels Directory

C. Game Logic Layer
- Major components:
- Simulator (simulator.cpp/h)
- Bot System (bot.cpp/h)
- Action System (action.h)

D. Container Systems
- This as a separate module
- Include:
- Deck System (deck.cpp/h)
- Swarm System (swarm.cpp/h)
- Tile Matrix (tile_matrix.cpp/h)

- Engine Core → Asset Management (asset loading)
- Engine Core → Game Logic (game state updates)
- Game Logic → Containers (game object management)
- Asset Management → All Layers (resource provision)

##### Component Details

- Key classes/files
- Primary responsibilities
- Direct dependencies

##### Architectural Patterns to Highlight

- Component-based architecture
- Resource management system
- Game loop pattern
- State management
- Isometric rendering pipeline

##### The level loading and parsing system's role

Keep the abstraction level focused on the major systems while showing their interactions, but avoid getting too deep into class-level details except where crucial for understanding the architecture.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef core fill:#b3d9ff,stroke:#333,stroke-width:2px
    classDef asset fill:#90EE90,stroke:#333,stroke-width:2px
    classDef logic fill:#FFE5B4,stroke:#333,stroke-width:2px
    classDef container fill:#FFA07A,stroke:#333,stroke-width:2px
    classDef resource fill:#E6E6E6,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        L1[Engine Core]:::core
        L2[Asset Management]:::asset
        L3[Game Logic]:::logic
        L4[Container Systems]:::container
        L5[Resources]:::resource
    end

    %% Engine Core Layer
    subgraph Engine
        GameLoop["Game Loop"]:::core
        Isometry["Isometry System"]:::core
        LevelParser["Level Parser"]:::core
        MenuSystem["Menu System"]:::core
        AssetMgmt["Asset Management"]:::core
    end

    %% Asset Management Layer
    subgraph Assets
        TexturesDir["Textures"]:::resource
        FontsDir["Fonts"]:::resource
        LevelsDir["Levels"]:::resource
        Level0["Level 0"]:::resource
        Level1["Level 1"]:::resource
    end

    %% Game Logic Layer
    subgraph GameLogic
        Simulator["Simulator"]:::logic
        BotSystem["Bot System"]:::logic
        ActionSystem["Action System"]:::logic
        CardSystem["Card System"]:::logic
        TileSystem["Tile System"]:::logic
        PaletteSystem["Palette System"]:::logic
    end

    %% Container Systems
    subgraph Containers
        DeckSystem["Deck System"]:::container
        SwarmSystem["Swarm System"]:::container
        TileMatrix["Tile Matrix"]:::container
    end

    %% Relationships
    GameLoop --> AssetMgmt
    GameLoop --> Simulator
    AssetMgmt --> TexturesDir
    AssetMgmt --> FontsDir
    AssetMgmt --> LevelsDir
    LevelsDir --> Level0
    LevelsDir --> Level1
    LevelParser --> LevelsDir
    Simulator --> ActionSystem
    Simulator --> BotSystem
    BotSystem --> ActionSystem
    ActionSystem --> DeckSystem
    ActionSystem --> SwarmSystem
    Isometry --> TileMatrix
    TileSystem --> TileMatrix
    CardSystem --> DeckSystem

    %% Click Events
    click GameLoop "https://github.com/rudrOwO/A-Maze/blob/master/Engine/game_loop.cpp"
    click Isometry "https://github.com/rudrOwO/A-Maze/blob/master/Engine/isometry.cpp"
    click LevelParser "https://github.com/rudrOwO/A-Maze/blob/master/Engine/level_parser.cpp"
    click MenuSystem "https://github.com/rudrOwO/A-Maze/blob/master/Engine/menu.cpp"
    click AssetMgmt "https://github.com/rudrOwO/A-Maze/blob/master/Engine/assets.h"
    click TexturesDir "https://github.com/rudrOwO/A-Maze/tree/master/Textures"
    click FontsDir "https://github.com/rudrOwO/A-Maze/tree/master/Fonts"
    click LevelsDir "https://github.com/rudrOwO/A-Maze/tree/master/Levels"
    click Level0 "https://github.com/rudrOwO/A-Maze/blob/master/Levels/level_0.txt"
    click Level1 "https://github.com/rudrOwO/A-Maze/blob/master/Levels/level_1.txt"
    click Simulator "https://github.com/rudrOwO/A-Maze/blob/master/Assets/simulator.cpp"
    click BotSystem "https://github.com/rudrOwO/A-Maze/blob/master/Assets/bot.cpp"
    click ActionSystem "https://github.com/rudrOwO/A-Maze/blob/master/Assets/action.h"
    click CardSystem "https://github.com/rudrOwO/A-Maze/blob/master/Assets/card.cpp"
    click TileSystem "https://github.com/rudrOwO/A-Maze/blob/master/Assets/tile.cpp"
    click PaletteSystem "https://github.com/rudrOwO/A-Maze/blob/master/Assets/palette.cpp"
    click DeckSystem "https://github.com/rudrOwO/A-Maze/blob/master/Assets/Containers/deck.cpp"
    click SwarmSystem "https://github.com/rudrOwO/A-Maze/blob/master/Assets/Containers/swarm.cpp"
    click TileMatrix "https://github.com/rudrOwO/A-Maze/blob/master/Assets/Containers/tile_matrix.cpp"
```
