# spic-prj-api-india/spic-prj-india architecture

> Architecture diagram of the GitHub repository spic-prj-api-india/spic-prj-india, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/spic-prj-api-india/spic-prj-india
- Repository: https://github.com/spic-prj-api-india/spic-prj-india

## Overview

##### Core Engine (GameEninge)
- This folder is the heart of the game engine and includes all of the engine’s subsystems.
- Key components include systems for rendering (Renderer, RenderingSystem, RenderGameObjects, RenderTextures), physics (PhysicsSystem, RigidBody, BoxCollider, CircleCollider), input (InputSystem, InputManager, IKeyListener, IMouseListener), audio (AudioManager, AudioFacade), networking (NetworkingSendSystem, NetworkingReceiveSystem, NetworkPacket), scene management (Scene, GameObject, EntityManager), and utility helpers (RandomHelper, StringHelper, etc.).
- The design here suggests a component-based design (with classes like BehaviourScript, Component) and an entity management system.

##### Game
- This folder includes the sample game code that uses the engine. It contains several C++ source files and headers implementing game logic, scenes (MenuScene, GameScene, WinScene, LoseScene, etc.), asset handling, and various scripts (synchronization, input, network listeners, etc.).
- Notable is the separation of game-specific logic from the core engine functionality.
- It also carries the game assets – textures, music, maps, etc.

##### UnitTests
- Contains tests covering critical functionalities such as audio, collision detection, input management, scene handling, and physics.
- This clearly indicates a modular, test-driven approach with tests assured by a separate Visual Studio project.

##### Additional Files & Build/Deployment
- The .github directory (and its workflows) along with files like Doxyfile, CodeCoverage.runsettings, and the solution file (spic-prj-India.sln) show that the project supports automated documentation generation (via Doxygen), code coverage analysis, and a structured build process via Visual Studio.
- The README and install scripts detail dependency installation using VCPKG, emphasizing that external libraries play a significant role.

a. Components:
- Core Engine Library (GameEninge) – include subcomponents for rendering, physics, audio, input, networking, scene/entity management, and any utility modules.
- Sample Game Application (Game) – show how it uses the static library; include components like game scenes, asset management, and game-specific scripts.
- Unit Testing Framework (UnitTests) – represent the testing suite which interacts with both the engine and the game logic.
- Build and Deployment Tools – include artifacts such as the Visual Studio solution file(s), GitHub workflows for documentation, and installation scripts.

b. Relationships and Interactions:
- Demonstrate that the Core Engine modules interact amongst themselves (for example, InputSystem feeding commands to Scene management, which is rendered by RenderingSystem).
- Integration between the Engine and external systems (like audio, physics, and networking libraries).
- That configuration and build systems (workflow, Doxyfile, and scripts) support both engineering processes (documentation, testing, deployment).

c. Architectural Patterns and Design Principles:
- Engine’s use of a component-based design (components, scripts, and the entity management system).
- Separation of concerns: the core engine functions are decoupled from game-specific logic and testing.
- That the engine is a static library to be linked with client game projects (as described in the README).

d. Technologies, Frameworks, and Tools:
- Visual Studio (solution files, project filters).
- VCPKG for package management (installation via PowerShell scripts).
- Doxygen for documentation (via provided Doxyfile and GitHub workflow).
- Any external libraries (inferred from file names, e.g., Box2D-like physics, SDL or other audio/graphics libraries).

- Since this is a static library intended for game development, clearly delineate the separation between the engine (providing core functionality) and the game (which uses that functionality).
- For the full-stack perspective within this game development context, ensure that data flow from user inputs, game logic, rendering, physics, and audio is clearly represented.
- Testing and tooling (documentation generation, CI workflows) as supporting infrastructure.

- Annotations for architectural patterns (like “Component-based Entity Management”, “Static Library Linking”, and “Automated Documentation/Testing”).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Infrastructure
    subgraph "External Infrastructure"
        extVCPKG["VCPKG Dependencies"]:::external
        extBuild["Build & Deployment Tools"]:::external
    end

    %% Core Engine Library and Subsystems
    subgraph "Core Engine Library"
        coreEngineMain["GameEninge"]:::engineMain
        engineRendering["Rendering Subsystem"]:::engine
        enginePhysics["Physics Subsystem"]:::engine
        engineInput["Input Subsystem"]:::engine
        engineAudio["Audio Subsystem"]:::engine
        engineNetworking["Networking Subsystem"]:::engine
        engineScene["Scene & Entity Management"]:::engine
        engineUtility["Utility & Components"]:::engine
    end

    %% Application and Testing Layers
    gameApp["Sample Game Application"]:::game
    unitTests["Unit Testing Framework"]:::test

    %% Composition: Core Engine Library includes its subsystems
    coreEngineMain --> engineRendering
    coreEngineMain --> enginePhysics
    coreEngineMain --> engineInput
    coreEngineMain --> engineAudio
    coreEngineMain --> engineNetworking
    coreEngineMain --> engineScene
    coreEngineMain --> engineUtility

    %% Internal Data Flow among Engine Subsystems
    engineInput -->|"feeds"| engineScene
    engineScene -->|"triggers"| engineRendering

    %% Dependencies from External Infrastructure to Core Engine
    extVCPKG --> coreEngineMain
    extBuild --> coreEngineMain

    %% Dependencies: Game Application and Unit Tests rely on Core Engine
    gameApp -->|"uses"| coreEngineMain
    unitTests -->|"tests"| coreEngineMain

    %% Click Events for Component Mapping
    click coreEngineMain "https://github.com/spic-prj-api-india/spic-prj-india/tree/main/GameEninge"
    click engineRendering "https://github.com/spic-prj-api-india/spic-prj-india/blob/main/GameEninge/Renderer.cpp"
    click enginePhysics "https://github.com/spic-prj-api-india/spic-prj-india/blob/main/GameEninge/PhysicsSystem.cpp"
    click engineInput "https://github.com/spic-prj-api-india/spic-prj-india/blob/main/GameEninge/InputSystem.cpp"
    click engineAudio "https://github.com/spic-prj-api-india/spic-prj-india/blob/main/GameEninge/AudioManager.cpp"
    click engineNetworking "https://github.com/spic-prj-api-india/spic-prj-india/blob/main/GameEninge/NetworkingSendSystem.cpp"
    click engineScene "https://github.com/spic-prj-api-india/spic-prj-india/blob/main/GameEninge/Scene.cpp"
    click engineUtility "https://github.com/spic-prj-api-india/spic-prj-india/blob/main/GameEninge/RandomHelper.cpp"
    click gameApp "https://github.com/spic-prj-api-india/spic-prj-india/tree/main/Game"
    click unitTests "https://github.com/spic-prj-api-india/spic-prj-india/tree/main/UnitTests"
    click extBuild "https://github.com/spic-prj-api-india/spic-prj-india/blob/main/spic-prj-India.sln"
    click extVCPKG "https://github.com/spic-prj-api-india/spic-prj-india/blob/main/installing_vcpkg.ps1"

    %% Styles
    classDef engine fill:#ADD8E6,stroke:#0000FF,stroke-width:2px;
    classDef engineMain fill:#B0C4DE,stroke:#4682B4,stroke-width:2px;
    classDef game fill:#90EE90,stroke:#006400,stroke-width:2px;
    classDef test fill:#FFD580,stroke:#FF8C00,stroke-width:2px;
    classDef external fill:#D3D3D3,stroke:#696969,stroke-width:2px;
```
