# danielbrauer/discoscience architecture

> Architecture diagram of the GitHub repository danielbrauer/discoscience, 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/danielbrauer/discoscience
- Repository: https://github.com/danielbrauer/discoscience

## Overview

##### Component Breakdown

- Game State Input (science lab status, ingredients)
- Settings Module (from settings.lua)
- Prototypes (from prototypes/labChanges.lua)

b) Core Processing Layer (Center):
- Lab Coloring System (core/labColoring.lua)
- Lab Renderers (core/labRenderers.lua)

d) Output Layer (Bottom):
- Rendering Interface
- Animation System
- Lab Visual Effects

##### Important Details

Annotations for:
- File paths for each component
- Key dependencies
- Testing coverage points
- API integration points

##### Specific Implementation Notes

Callouts for:
- Lab animation system
- Performance considerations
- Mod lifecycle hooks

##### The testing framework's coverage

- Where lab state changes are processed
- How animations are synchronized
- Where performance-critical paths exist

## Diagram (Mermaid)

```mermaid
graph TB
    %% Style Definitions
    classDef input fill:#a8d1f0,stroke:#333
    classDef core fill:#90EE90,stroke:#333
    classDef utility fill:#FFE5B4,stroke:#333
    classDef output fill:#DDA0DD,stroke:#333
    classDef testing fill:#D3D3D3,stroke:#333
    
    subgraph Input["Input Layer"]
        GameState["Game State Input"]:::input
        Settings["Settings Module"]:::input
        Prototypes["Prototypes System"]:::input
    end

    subgraph Core["Core Processing Layer"]
        LabColoring["Lab Coloring System"]:::core
        LabRenderers["Lab Renderers"]:::core
        ResearchColor["Research Color Processing"]:::core
        MainControl["Main Control System"]:::core
        DataInit["Data Initialization"]:::core
    end

    subgraph Utility["Utility Layer"]
        ColorMath["Color Math Utilities"]:::utility
    end

    subgraph Output["Output/Rendering Layer"]
        RenderInterface["Rendering Interface"]:::output
        AnimationSystem["Animation System"]:::output
        VisualEffects["Lab Visual Effects"]:::output
    end

    subgraph Testing["Testing Framework"]
        TestFramework["Test Suites"]:::testing
        MockSystem["Mock System"]:::testing
    end

    subgraph Localization["Localization"]
        LocaleSystem["Locale System"]:::utility
    end

    %% Connections
    GameState --> LabColoring
    GameState --> ResearchColor
    Settings --> LabColoring
    Prototypes --> LabRenderers
    
    LabColoring --> RenderInterface
    LabRenderers --> AnimationSystem
    ResearchColor --> VisualEffects
    
    ColorMath --> LabColoring
    ColorMath --> ResearchColor
    ColorMath --> LabRenderers
    
    MainControl --> LabColoring
    MainControl --> LabRenderers
    MainControl --> ResearchColor
    
    DataInit --> Prototypes
    
    TestFramework --> MockSystem
    MockSystem --> Core
    
    LocaleSystem --> Core

    %% Click Events
    click Settings "https://github.com/danielbrauer/DiscoScience/blob/master/src/settings.lua"
    click Prototypes "https://github.com/danielbrauer/DiscoScience/blob/master/src/prototypes/labChanges.lua"
    click LabColoring "https://github.com/danielbrauer/DiscoScience/blob/master/src/core/labColoring.lua"
    click LabRenderers "https://github.com/danielbrauer/DiscoScience/blob/master/src/core/labRenderers.lua"
    click ResearchColor "https://github.com/danielbrauer/DiscoScience/blob/master/src/core/researchColor.lua"
    click ColorMath "https://github.com/danielbrauer/DiscoScience/blob/master/src/utils/colorMath.lua"
    click MainControl "https://github.com/danielbrauer/DiscoScience/blob/master/src/control.lua"
    click DataInit "https://github.com/danielbrauer/DiscoScience/blob/master/src/data.lua"
    click LocaleSystem "https://github.com/danielbrauer/DiscoScience/blob/master/locale/en/locale.cfg"
    click TestFramework "https://github.com/danielbrauer/DiscoScience/tree/master/spec"
    click MockSystem "https://github.com/danielbrauer/DiscoScience/tree/master/spec/mocks"

    %% Legend
    subgraph Legend
        InputLegend["Input Components"]:::input
        CoreLegend["Core Processing"]:::core
        UtilityLegend["Utility Components"]:::utility
        OutputLegend["Output Components"]:::output
        TestingLegend["Testing Components"]:::testing
    end
```
