# arnavmehta3000/ryu architecture

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

- Interactive diagram: https://gitdiagram.com/arnavmehta3000/ryu
- Repository: https://github.com/arnavmehta3000/ryu

## Overview

##### Main Components Identification

The system should be represented with these key components:

a) Core Engine Layer:
- Common System (StandardTypes, Interfaces)
- Logger System
- Event System
- Math System
- Config System
- Utils (Service Locator, UUID, etc.)

b) Graphics Layer (Multi-Backend):
- Graphics RHI (Abstract Interface)
- DX11 Implementation
- DX12 Implementation
- Renderer System

c) Engine Systems:
- Input System
- Scripting System (AngelScript)
- Application Layer
- Game Layer (World, Entity System)

**┌─────────────────────────────────────────┐**
- Editor / Testbench Applications         │
- ┤
- Game Layer (World, Entity, Subsystems)  │
- ┤
- Engine Core                             │
- ┬───────────┬────────────┤
- Graphics      │ Input     │ Scripting  │
- (RHI/DX11/12) │ System    │ System     │
- ┴───────────┴────────────┤
- Common Systems (Logger, Event, Math)    │
- ┘

##### Component Relationships

- Graphics RHI → DX11/DX12 Implementations
- Engine Core → Graphics/Input/Scripting Systems
- Game Layer → Engine Core
- Applications → Game Layer

##### External Dependencies
A separate section showing:
- AngelScript
- DirectX Headers
- EnTT
- ImGui
- Other utilities

##### Implementation Details

- Service Locator pattern usage
- Event system architecture
- Graphics abstraction layer
- Script component system
- World and entity management

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Applications
        Editor["Editor/Testbench"]:::application
    end

    subgraph GameLayer
        World["World System"]:::game
        click World "https://github.com/ArnavMehta3000/Ryu/blob/main/Ryu/Game/Game/World.h"
        Entity["Entity System"]:::game
        click Entity "https://github.com/ArnavMehta3000/Ryu/blob/main/Ryu/Game/Game/Entity.h"
        WorldSub["World Subsystems"]:::game
        click WorldSub "https://github.com/ArnavMehta3000/Ryu/blob/main/Ryu/Game/Game/IWorldSubsystem.h"
    end

    subgraph EngineCore
        App["Application Layer"]:::core
        click App "https://github.com/ArnavMehta3000/Ryu/blob/main/Ryu/App/App/Application.h"
        Window["Window System"]:::core
        click Window "https://github.com/ArnavMehta3000/Ryu/blob/main/Ryu/App/App/Window.h"
    end

    subgraph Systems
        direction TB
        subgraph Graphics
            RHI["Graphics RHI"]:::graphics
            click RHI "https://github.com/ArnavMehta3000/Ryu/tree/main/Ryu/GraphicsRHI/GraphicsRHI/"
            DX11["DirectX 11"]:::graphics
            click DX11 "https://github.com/ArnavMehta3000/Ryu/tree/main/Ryu/GraphicsDX11/GraphicsDX11/"
            DX12["DirectX 12"]:::graphics
            click DX12 "https://github.com/ArnavMehta3000/Ryu/tree/main/Ryu/GraphicsDX12/GraphicsDX12/"
            Renderer["Renderer System"]:::graphics
            click Renderer "https://github.com/ArnavMehta3000/Ryu/blob/main/Ryu/Graphics/Graphics/Renderer.h"
        end

        subgraph Input
            InputSys["Input System"]:::input
            click InputSys "https://github.com/ArnavMehta3000/Ryu/tree/main/Ryu/Input/Input/"
            Keyboard["Keyboard"]:::input
            click Keyboard "https://github.com/ArnavMehta3000/Ryu/blob/main/Ryu/Input/Input/Devices/Keyboard.h"
            Mouse["Mouse"]:::input
            click Mouse "https://github.com/ArnavMehta3000/Ryu/blob/main/Ryu/Input/Input/Devices/Mouse.h"
        end

        subgraph Scripting
            ScriptEngine["Script Engine"]:::script
            click ScriptEngine "https://github.com/ArnavMehta3000/Ryu/blob/main/Ryu/Scripting/Scripting/ScriptEngine.h"
            ScriptComp["Script Component"]:::script
            click ScriptComp "https://github.com/ArnavMehta3000/Ryu/blob/main/Ryu/Scripting/Scripting/ScriptComponent.h"
        end
    end

    subgraph CommonSystems
        direction TB
        Common["Common System"]:::common
        click Common "https://github.com/ArnavMehta3000/Ryu/tree/main/Ryu/Common/Common/"
        Logger["Logger System"]:::common
        click Logger "https://github.com/ArnavMehta3000/Ryu/tree/main/Ryu/Logger/Logger/"
        Event["Event System"]:::common
        click Event "https://github.com/ArnavMehta3000/Ryu/tree/main/Ryu/Event/Event/"
        Math["Math System"]:::common
        click Math "https://github.com/ArnavMehta3000/Ryu/tree/main/Ryu/Math/Math/"
        Config["Config System"]:::common
        click Config "https://github.com/ArnavMehta3000/Ryu/tree/main/Ryu/Config/Config/"
        Utils["Utils"]:::common
        click Utils "https://github.com/ArnavMehta3000/Ryu/tree/main/Ryu/Utils/Utils/"
    end

    %% Relationships
    Editor --> World
    World --> Entity
    World --> WorldSub
    World --> App
    App --> Window
    App --> RHI
    RHI --> DX11
    RHI --> DX12
    RHI --> Renderer
    App --> InputSys
    InputSys --> Keyboard
    InputSys --> Mouse
    App --> ScriptEngine
    ScriptEngine --> ScriptComp

    %% Common System Dependencies
    App --> Common
    App --> Logger
    App --> Event
    App --> Math
    App --> Config
    App --> Utils

    %% Styles
    classDef common fill:#2196F3,stroke:#1565C0,color:white
    classDef graphics fill:#4CAF50,stroke:#2E7D32,color:white
    classDef input fill:#FF9800,stroke:#EF6C00,color:white
    classDef script fill:#9C27B0,stroke:#6A1B9A,color:white
    classDef core fill:#3F51B5,stroke:#283593,color:white
    classDef game fill:#FF5722,stroke:#D84315,color:white
    classDef application fill:#673AB7,stroke:#4527A0,color:white
```
