# mrsharpoblunto/mgdf architecture

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

- Interactive diagram: https://gitdiagram.com/mrsharpoblunto/mgdf
- Repository: https://github.com/mrsharpoblunto/mgdf

## Overview

##### Main Components Overview

a) Core Framework (C++)
- DirectX 11 Graphics System
- Input System (RawInput/XInput)
- Audio System (OpenAL)
- Virtual File System
- Game Bootstrap System

b) Games Manager (.NET)
- Game Launch Interface
- Update Management
- User Interface Layer

c) Statistics Services
- WCF Service Layer
- REST API Interface
- Statistics Collection System

##### Component Relationships

a) Core Framework Interactions:
**[Game DLL] ←→ [Core Framework]**
- ↓
**[Graphics Engine] → [DirectX 11]**
**[Input System] → [RawInput/XInput]**
**[Audio System] → [OpenAL]**
**[Virtual File System] → [Archive System]**

b) Games Manager Flow:
**[User Interface] → [Launch Manager]**
- ↓
**[Update System] → [AWS S3 Integration]**
- ↓
**[Core Framework]**

c) Statistics Service Integration:
**[Games] → [Statistics Collector]**
- ↓
**[WCF Service] → [REST API]**

##### Detailed Component Breakdown

For each major component, include:

Core Framework:
- Thread Management System
- Resource Management
- Preference System
- Render Loop
- Simulation Loop

Games Manager:
- Update Checker
- Version Management
- Installation Handler
- Registry Manager
- Shortcut Manager

Statistics Services:
- Data Collection
- Privacy Controls
- API Endpoints
- Authentication

##### Integration Points

Integration points:
- Game DLL Loading Interface
- Virtual File System Plugins
- Statistics Service REST Endpoints
- Update System S3 Integration

##### Configuration Flow

Configuration management:
**[preferences.json] → [Core Framework]**
**[game.json] → [Games Manager]**
**[Update.json] → [Update System]**

##### Deployment View

A separate section showing:
- Windows Platform Integration
- File System Structure
- Runtime Dependencies
- Update Distribution Path

Remember to emphasize the modular nature of the system and how components can be optionally included or excluded based on requirements.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Core["Core Framework"]
        direction TB
        GBS["Game Bootstrap System"]:::core
        DX11["DirectX 11 Graphics"]:::core
        Input["Input System"]:::core
        Audio["Audio System"]:::core
        VFS["Virtual File System"]:::core
        ThreadMgr["Thread Management"]:::core
        ResMgr["Resource Management"]:::core
        PrefSys["Preference System"]:::core
        RenderLoop["Render Loop"]:::core
        SimLoop["Simulation Loop"]:::core
        Archive["Archive System"]:::core
    end

    subgraph GM["Games Manager"]
        direction TB
        GLI["Game Launch Interface"]:::gm
        UM["Update Management"]:::gm
        UI["User Interface Layer"]:::gm
        UpdateCheck["Update Checker"]:::gm
        VerMgr["Version Management"]:::gm
        InstHandler["Installation Handler"]:::gm
        RegMgr["Registry Manager"]:::gm
        ShortcutMgr["Shortcut Manager"]:::gm
    end

    subgraph Stats["Statistics Services"]
        direction TB
        WCF["WCF Service Layer"]:::stats
        REST["REST API Interface"]:::stats
        StatsColl["Statistics Collection"]:::stats
        Privacy["Privacy Controls"]:::stats
        APIEnd["API Endpoints"]:::stats
        Auth["Authentication"]:::stats
    end

    subgraph Config["Configuration"]
        direction TB
        PrefJSON["preferences.json"]:::config
        GameJSON["game.json"]:::config
        UpdateJSON["Update.json"]:::config
    end

    subgraph Ext["External Dependencies"]
        direction TB
        RawInput["RawInput/XInput"]:::ext
        OpenAL["OpenAL"]:::ext
        AWS["AWS S3"]:::ext
    end

    %% Core Framework Relationships
    GBS --> DX11
    GBS --> Input
    GBS --> Audio
    GBS --> VFS
    Input --> RawInput
    Audio --> OpenAL
    VFS --> Archive

    %% Games Manager Relationships
    UI --> GLI
    GLI --> GBS
    UM --> AWS
    UM --> Core

    %% Statistics Service Relationships
    StatsColl --> WCF
    WCF --> REST

    %% Configuration Relationships
    PrefJSON --> PrefSys
    GameJSON --> GLI
    UpdateJSON --> UM

    %% Click Events
    click GBS "https://github.com/mrsharpoblunto/MGDF/blob/master/src/core/core.impl/MGDFGameBuilder.cpp"
    click Input "https://github.com/mrsharpoblunto/MGDF/tree/master/src/core/input/xinput/"
    click Audio "https://github.com/mrsharpoblunto/MGDF/tree/master/src/core/audio/openal/"
    click VFS "https://github.com/mrsharpoblunto/MGDF/tree/master/src/core/vfs/"
    click Core "https://github.com/mrsharpoblunto/MGDF/tree/master/src/core/"
    click Archive "https://github.com/mrsharpoblunto/MGDF/tree/master/src/core/vfs/archive/"
    click GLI "https://github.com/mrsharpoblunto/MGDF/blob/master/src/GamesManager/GamesManager.Model/ProcessManager.cs"
    click UM "https://github.com/mrsharpoblunto/MGDF/tree/master/src/GamesManager/GamesManager.FrameworkUpdater/"
    click UI "https://github.com/mrsharpoblunto/MGDF/tree/master/src/GamesManager/GamesManager.Controls/"
    click WCF "https://github.com/mrsharpoblunto/MGDF/tree/master/src/GamesManager/GamesManager.StatisticsService.Contracts/"
    click StatsColl "https://github.com/mrsharpoblunto/MGDF/blob/master/src/GamesManager/GamesManager.Model/StatisticsSession.cs"
    click PrefJSON "https://github.com/mrsharpoblunto/MGDF/blob/master/content/resources/preferences.json"
    click GameJSON "https://github.com/mrsharpoblunto/MGDF/blob/master/content/game/game.json"

    %% Styling
    classDef core fill:#a8d1f0
    classDef gm fill:#90EE90
    classDef stats fill:#FFB347
    classDef ext fill:#D3D3D3
    classDef config fill:#DDA0DD
```
