# azuradara/neo-act-plugin architecture

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

- Interactive diagram: https://gitdiagram.com/azuradara/neo-act-plugin
- Repository: https://github.com/azuradara/neo-act-plugin

## Overview

##### Project Components
- Plugin Entry & Loader: At the root level and within the NeoActPlugin project, you have the plugin loader (e.g., PluginLoader.cs, AssemblyResolver.cs) and configuration files (App.config, AssemblyInfo.cs) necessary for ACT integration.
- Core Functionality (NeoActPlugin.Core): This project contains the business logic. It includes:
- UI Controls: Custom controls like ControlPanel, LogPanel, and extended TabControl.
- Event Handling: Components like EventDispatcher, IEventReceiver, and logging (Logger, LogWriter, LogParser).
- Native Interactions: It contains calls to external memory through NativeMethods and Reader classes.
- Shared/Common Library (NeoActPlugin.Common): Holds cross-cutting concerns shared across modules, such as logging interfaces (ILogger), plugin and overlay configuration (IOverlayConfig, IPluginConfig), configuration objects (OverlayConfigList), and a lightweight IoC container (TinyIoC). This separation encourages reusability and decoupling.
- Updater (NeoActPlugin.Updater): Provides auto-update functionality with classes like Installer, Updater, and wrappers (e.g., CurlWrapper, HttpClientWrapper) to handle web requests and installation UI (ProgressDisplay, UpdateQuestionForm). This module interacts with external resources (via network calls) to pull new updates.
- Overlay Resources (public/overlays): HTML, CSS, and JavaScript files that support the custom “Live-like” overlay, which shows the DPS results. This directory represents the static assets served via an external URL (or locally integrated in ACT via its overlay plugin).

##### Relationships & Interactions
- The ACT plugin official entry point connects ACT to the NeoActPlugin. From here, the PluginLoader activates the Core functionality and initializes common services.
- The Core module depends on the Common library for shared abstractions (logging, configuration) and also uses its custom UI controls to interact with users.
- The Updater module works independently of the core functionality but is integrated into the overall plugin and checks for and deploys new versions.
- The overlay module (found in the public directory) is not directly compiled with the project but is referenced by ACT’s OverlayPlugin. The Core module could indirectly manage its configuration or trigger its updates.
- Unit tests in NeoActPlugin.Test provide validation for core components, ensuring proper parsing and log processing.
- External dependencies include ACT itself (which hosts the plugin), any web services for updates, and third-party libraries indicated in the Thirdparty and packages.config files.

##### Architectural Patterns and Design Principles
- Separation of Concerns: The project cleanly separates core functions (combat log parsing, UI control) from shared utilities (Common) and update functionality (Updater).
- Modular Design: Having distinct projects for Common, Core, and Updater demonstrates a modular approach granting ease of maintenance and enhancement.
- Dependency Injection: The presence of TinyIoC suggests a lightweight IoC container is used to manage dependencies between components.
- Event-Driven: With an EventDispatcher and event receivers, the project likely follows an event-driven model to handle asynchronous data flows from combat log parsing.
- MVC-ish UI Design: The custom Controls in the Core directory indicate a separation between the user interface (ControlPanel, LogPanel) and the underlying data processing.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A("ACT (Advanced Combat Tracker)"):::external
    EWS("External Web Services"):::external

    subgraph "Plugin Entry & Loader"
        PL("Plugin Entry & Loader"):::loader
    end

    subgraph "Core Engine"
        CE1("PluginMain.cs (Main Logic)"):::core
        UI("UI Controls (ControlPanel, LogPanel, TabControlExt)"):::core
        EH("Event Handling (EventDispatcher, IEventReceiver, LogParser, Logger, LogWriter)"):::core
        NI("Native Interactions (NativeMethods, Reader)"):::core
    end

    subgraph "Common Library"
        CL1("Shared Interfaces & IoC (ILogger, IOverlayConfig, IPluginConfig, OverlayConfigList, TinyIoC)"):::common
    end

    subgraph "Updater Module"
        UP1("Auto-Update (Updater, Installer)"):::updater
        NW("Network Wrappers (CurlWrapper, HttpClientWrapper)"):::updater
        UIU("Installation UI (ProgressDisplay, UpdateQuestionForm)"):::updater
    end

    subgraph "Overlay Resources"
        OR1("Static Assets (HTML, CSS, JS)"):::overlay
    end

    subgraph "Unit Tests"
        UT1("Testing (LogParserRegexTest, MSTestSettings)"):::test
    end

    %% Connections
    A -->|"loads"| PL
    PL -->|"initializes"| CE1
    CE1 -->|"dependsOn"| CL1
    CE1 -->|"configuresOverlay"| OR1
    UP1 -->|"uses"| NW
    NW -->|"contacts"| EWS
    UP1 -->|"displays"| UIU
    UT1 -->|"validates"| CE1
    OR1 -->|"servedBy"| A

    %% Click Events
    click PL "https://github.com/azuradara/neo-act-plugin/blob/main/NeoActPlugin/PluginLoader.cs"
    click CE1 "https://github.com/azuradara/neo-act-plugin/blob/main/NeoActPlugin.Core/PluginMain.cs"
    click UI "https://github.com/azuradara/neo-act-plugin/tree/main/NeoActPlugin.Core/Controls"
    click EH "https://github.com/azuradara/neo-act-plugin/blob/main/NeoActPlugin.Core/EventDispatcher.cs"
    click NI "https://github.com/azuradara/neo-act-plugin/blob/main/NeoActPlugin.Core/NativeMethods.cs"
    click CL1 "https://github.com/azuradara/neo-act-plugin/blob/main/NeoActPlugin.Common"
    click UP1 "https://github.com/azuradara/neo-act-plugin/blob/main/NeoActPlugin.Updater"
    click NW "https://github.com/azuradara/neo-act-plugin/blob/main/NeoActPlugin.Updater"
    click OR1 "https://github.com/azuradara/neo-act-plugin/tree/main/public/overlays/live-like"
    click UT1 "https://github.com/azuradara/neo-act-plugin/blob/main/NeoActPlugin.Test"

    %% Styles
    classDef loader fill:#f9d423,stroke:#000,stroke-width:2px;
    classDef core fill:#8ecae6,stroke:#000,stroke-width:2px;
    classDef common fill:#ffb703,stroke:#000,stroke-width:2px;
    classDef updater fill:#219ebc,stroke:#000,stroke-width:2px;
    classDef overlay fill:#ff4e50,stroke:#000,stroke-width:2px;
    classDef test fill:#9b5de5,stroke:#000,stroke-width:2px;
    classDef external fill:#caf0f8,stroke:#000,stroke-width:2px;
```
