# mudzereli/mudsort architecture

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

## Overview

##### Project Type Analysis
This is a plugin application (mudsort.dll) for the Decal platform, which interfaces with Asheron's Call game. It's a specialized inventory management tool that requires integration with both Decal and Virindi Views services.

##### Main Components

A. Core Components:
- Plugin Core (PluginCore.cs)
- Main View Controller (MainView.cs)
- State Management (State.cs)
- Settings Handler (Settings.cs)

B. External Dependencies:
- Asheron's Call Game Client
- Decal Platform
- Virindi Views Service

C. Utility Components:
- Sorting Engine (AlphanumComparator.cs)
- Enums and Flags (Enums.cs, SortFlag.cs)
- Utility Functions (Util.cs)

**┌─ External Game Layer ─────────────────┐**
- ┌─────────────┐      ┌─────────────┐ │
- Asheron's   │      │   Decal     │ │
- Call     │◄────►│  Platform   │ │
- ┘      └─────────────┘ │
- ┬─────────────────────┘

**┌───────────────▼─────────────────────┐**
- Plugin Integration Layer             │
- ┌─────────────┐  ┌───────────────┐  │
- Virindi    │  │  PluginCore   │  │
- Views     │◄─┤               │  │
- ┘  └───────────────┘  │
- ┬─────────────────────┘

**┌───────────────▼─────────────────────┐**
- Application Layer                    │
- ┌─────────────┐  ┌───────────────┐  │
- MainView   │◄─┤    State      │  │
- Controller  │  │   Manager     │  │
- ┘  └───────────────┘  │
- ┬─────────────────────┘

**┌───────────────▼─────────────────────┐**
- Business Logic Layer                 │
- ┌─────────────┐  ┌───────────────┐  │
- Sorting   │  │   Settings    │  │
- Engine    │  │   Handler     │  │
- ┘  └───────────────┘  │
- ┘

##### Important Relationships to Highlight
- Command flow from UI to sorting engine
- Event handling between Decal platform and plugin
- Demonstrate the data flow for inventory management
- Configuration management through Settings

##### Key Interactions to Document
- Inventory identification process
- Sorting workflow
- Container management
- Inter-process communication with game client

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef external fill:#a8d1f0,stroke:#333
    classDef integration fill:#90EE90,stroke:#333
    classDef application fill:#FFB366,stroke:#333
    classDef business fill:#FFE5B4,stroke:#333
    classDef utility fill:#E6E6FA,stroke:#333

    %% External Game Layer
    subgraph ExternalLayer["External Game Layer"]
        AC["Asheron's Call"]:::external
        DP["Decal Platform"]:::external
        AC <--> DP
    end

    %% Plugin Integration Layer
    subgraph IntegrationLayer["Plugin Integration Layer"]
        VV["Virindi Views"]:::integration
        PC["Plugin Core"]:::integration
        DP --> PC
        PC --> VV
    end

    %% Application Layer
    subgraph AppLayer["Application Layer"]
        MV["Main View Controller"]:::application
        SM["State Manager"]:::application
        GC["Global Constants"]:::application
        PC --> MV
        MV <--> SM
        GC --> MV
    end

    %% Business Logic Layer
    subgraph BusinessLayer["Business Logic Layer"]
        SE["Sorting Engine"]:::business
        SH["Settings Handler"]:::business
        EF["Enums and Flags"]:::business
        UF["Utility Functions"]:::business
        SE <--> SH
        SE --> EF
        SE --> UF
    end

    %% Cross-layer connections
    MV --> SE
    SM --> SH
    PC --> SH

    %% Legend
    subgraph Legend
        L1["External Systems"]:::external
        L2["Integration Components"]:::integration
        L3["Application Components"]:::application
        L4["Business Logic"]:::business
        L5["Utility Components"]:::utility
    end

    %% Click events for component mapping
    click PC "https://github.com/mudzereli/mudsort/blob/master/PluginCore.cs"
    click MV "https://github.com/mudzereli/mudsort/blob/master/MainView.cs"
    click SM "https://github.com/mudzereli/mudsort/blob/master/State.cs"
    click SH "https://github.com/mudzereli/mudsort/blob/master/Settings.cs"
    click SE "https://github.com/mudzereli/mudsort/blob/master/AlphanumComparator.cs"
    click EF "https://github.com/mudzereli/mudsort/blob/master/Enums.cs"
    click UF "https://github.com/mudzereli/mudsort/blob/master/Util.cs"
    click GC "https://github.com/mudzereli/mudsort/blob/master/Globals.cs"
```
