# k073l/s1-furnituredelivery architecture

> Architecture diagram of the GitHub repository k073l/s1-furnituredelivery, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/k073l/s1-furnituredelivery
- Repository: https://github.com/k073l/s1-furnituredelivery

## Overview

##### Project type and purpose
- This is a Unity-based game mod written in C#, loaded via MelonLoader.
- Purpose: extend the in-game “deliveries” system by adding new furniture, equipment, curios, and weapons as shop items.

##### File structure
- Top level
- FurnitureDelivery.csproj – C# project file targeting .NET for Unity (IL2CPP and Mono builds)
- MainMod.cs – entry point for MelonLoader
- Patches.cs – Harmony or similar patches into game methods
- Helpers/ – builder classes and common utilities
- Interop/ – optional integration with the “More Guns” mod
- Shops/ – one class per shop, each declares a list of items
- assets/ – images (e.g. listing.png) for README or in-game UI
- build/ – MSBuild props and targets steering IL2CPP vs Mono packaging

##### README
- Confirms it’s a MelonLoader mod for a game with a “deliveries” app
- Lists four delivery services (“Dan’s Furniture”, “Oscar’s Equipment”, etc.) and their items
- Notes dependency on More Guns mod for some weapons

##### Main components and their relationships
a. Game Engine (Unity)
↳ MelonLoader injection layer
b. FurnitureDelivery Mod (loaded by MelonLoader)
- MainMod: mod metadata and bootstrap
- Patches: apply runtime hooks to game’s delivery UI and item registry
- Shop modules (Shops/*.cs): define and register each store’s offerings
- Helpers: builder patterns to construct shop items, logging, utility functions
- Interop: detects and integrates More Guns mod when present
c. External Services & Assets
- More Guns mod (optional)
- assets folder for UI sprites

Data flow:
Game startup → MelonLoader loads MainMod → Patches hook into delivery system → Shops classes invoke Helpers to build item definitions → Game’s delivery UI displays new items → (if installed) Interop augments with More Guns items

##### Architectural patterns and principles
- Plugin/Mod architecture: decoupled from game code via MelonLoader
- Builder pattern (DeliveryShopBuilder, LandVehicleBuilder) for item instantiation
- Conditional integration (Interop) for optional dependencies
- Separation of concerns: MainMod vs Patches vs Shops vs Helpers

##### Essential details
- Shop class under a “Shops” sub-component
- Call out Patches applying to game namespaces/methods
- Distinguish between pre-build (build/ folder) and runtime (MainMod/Patches)

## Diagram (Mermaid)

```mermaid
graph TB
    %% Core components
    CoreGame["Unity Game Engine"]:::game
    subgraph "Mod Loader"
        MelonLoader["MelonLoader Injector"]:::loader
    end

    %% FurnitureDelivery Mod
    subgraph "FurnitureDelivery Mod"
        MainMod["MainMod"]:::mod
        Patches["Patches"]:::mod

        subgraph "Shops"
            DanShop["DanShop"]:::shop
            HerbertShop["HerbertShop"]:::shop
            OscarShop["OscarShop"]:::shop
            StanShop["StanShop"]:::shop
        end

        subgraph "Helpers"
            DeliveryShopBuilder["DeliveryShopBuilder"]:::helper
            LandVehicleBuilder["LandVehicleBuilder"]:::helper
            MelonLoggerExtensions["MelonLoggerExtensions"]:::helper
            Utils["Utils"]:::helper
        end

        Interop["MoreGunsInterop"]:::interop
    end

    %% External Mod and assets
    MoreGuns["More Guns Mod"]:::external
    Assets["assets"]:::asset

    %% Build configuration
    subgraph "Build Config"
        conditions["conditions.props"]:::build
        preBuild["preBuild.targets"]:::build
        postBuild["postBuild.targets"]:::build
        paths["paths.props"]:::build
        melonIL2CPP["MelonIL2CPP.targets"]:::build
        melonMono["MelonMono.targets"]:::build
    end

    %% Data flows and dependencies
    CoreGame --> MelonLoader
    MelonLoader --> MainMod
    MainMod --> Patches
    Patches -->|"hooks delivery UI and registry"| CoreGame

    DanShop -->|"builds items via"| DeliveryShopBuilder
    HerbertShop -->|"builds items via"| DeliveryShopBuilder
    OscarShop -->|"builds items via"| DeliveryShopBuilder
    StanShop -->|"builds items via"| DeliveryShopBuilder

    DeliveryShopBuilder -->|"registers items to"| CoreGame
    LandVehicleBuilder -->|"used by shops for vehicle items"| DeliveryShopBuilder
    Utils -->|"utilities used by"| DeliveryShopBuilder
    MelonLoggerExtensions -->|"logging for"| MainMod

    Interop -.->|optional integration| MoreGuns
    Interop -->|augment registrations| DanShop
    Interop -->|augment registrations| DeliveryShopBuilder

    Assets -->|"provides UI sprites to"| MainMod

    %% Build to project linkage
    conditions -->|configures build for| MainMod
    preBuild -->|prebuild steps for| MainMod
    postBuild -->|postbuild steps for| MainMod
    paths -->|defines paths for| MainMod
    melonIL2CPP -->|IL2CPP targets for| MainMod
    melonMono -->|Mono targets for| MainMod

    %% Click Events
    click MainMod "https://github.com/k073l/s1-furnituredelivery/blob/master/MainMod.cs"
    click Patches "https://github.com/k073l/s1-furnituredelivery/blob/master/Patches.cs"
    click DanShop "https://github.com/k073l/s1-furnituredelivery/blob/master/Shops/DanShop.cs"
    click HerbertShop "https://github.com/k073l/s1-furnituredelivery/blob/master/Shops/HerbertShop.cs"
    click OscarShop "https://github.com/k073l/s1-furnituredelivery/blob/master/Shops/OscarShop.cs"
    click StanShop "https://github.com/k073l/s1-furnituredelivery/blob/master/Shops/StanShop.cs"
    click DeliveryShopBuilder "https://github.com/k073l/s1-furnituredelivery/blob/master/Helpers/DeliveryShopBuilder.cs"
    click LandVehicleBuilder "https://github.com/k073l/s1-furnituredelivery/blob/master/Helpers/LandVehicleBuilder.cs"
    click MelonLoggerExtensions "https://github.com/k073l/s1-furnituredelivery/blob/master/Helpers/MelonLoggerExtensions.cs"
    click Utils "https://github.com/k073l/s1-furnituredelivery/blob/master/Helpers/Utils.cs"
    click Interop "https://github.com/k073l/s1-furnituredelivery/blob/master/Interop/MoreGunsInterop.cs"
    click CoreGame "https://github.com/k073l/s1-furnituredelivery/blob/master/FurnitureDelivery.csproj"
    click Assets "https://github.com/k073l/s1-furnituredelivery/tree/master/assets/"
    click conditions "https://github.com/k073l/s1-furnituredelivery/blob/master/build/conditions.props"
    click preBuild "https://github.com/k073l/s1-furnituredelivery/blob/master/build/events/preBuild.targets"
    click postBuild "https://github.com/k073l/s1-furnituredelivery/blob/master/build/events/postBuild.targets"
    click paths "https://github.com/k073l/s1-furnituredelivery/blob/master/build/paths.props"
    click melonIL2CPP "https://github.com/k073l/s1-furnituredelivery/blob/master/build/references/MelonIL2CPP.targets"
    click melonMono "https://github.com/k073l/s1-furnituredelivery/blob/master/build/references/MelonMono.targets"

    %% Styles
    classDef game fill:#FFEECC,stroke:#FFCC00,stroke-width:2px
    classDef loader fill:#DDEEFF,stroke:#3399FF,stroke-width:2px
    classDef mod fill:#CCFFCC,stroke:#33CC33,stroke-width:2px
    classDef shop fill:#E8F8E0,stroke:#2ECC71,stroke-width:1.5px
    classDef helper fill:#FFF0F5,stroke:#FF66B2,stroke-width:1.5px
    classDef interop fill:#F0F8FF,stroke:#66B2FF,stroke-width:1.5px,stroke-dasharray: 5 5
    classDef external fill:#F5F5F5,stroke:#999999,stroke-width:2px,stroke-dasharray: 5 5
    classDef asset fill:#FFF8DC,stroke:#FFCC66,stroke-width:2px
    classDef build fill:#F0FFF0,stroke:#66CC66,stroke-width:1px,stroke-dasharray: 2 2
```
