# toby222/vpe-better-autocast architecture

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

- Interactive diagram: https://gitdiagram.com/toby222/vpe-better-autocast
- Repository: https://github.com/toby222/vpe-better-autocast

## Overview

##### Component Relationships

a) Core Components (Rectangle, Blue):
- BetterAutocastVPE.cs (Main Entry Point)
- PsycastingHandler.cs (Core Logic)
- AutocastSettings.cs (Configuration)

b) Helper Modules (Hexagons, Green):
- AreaHelper
- EnchantHelper
- MendHelper
- PawnHelper
- ThingHelper
- WeatherHelper

c) Game Integration Points (Diamonds, Orange):
- Patch System
- AreaManager patches
- Pawn patches
- Autocast patches

d) Feature Modules (Rounded Rectangles, Purple):
- Area System
- CraftTimeskip
- GreaterRuneCircle
- IceCrystal
- RuneCircle
- SolarPinhole

##### Version Compatibility Layer
- 1.4 Compatibility
- 1.5 Compatibility
- Mod Compatibility (VanillaPsycastsExpanded, Puppeteer, etc.)

##### Compatibility → Core: Mod integration points

Level of Detail:
- Keep main components visible at a glance
- Use collapsible/expandable sections for detailed subsystems
- Maintain clear boundaries between mod components and game integration points

##### The flow of data and control through the system

Remember to include version-specific considerations and mod compatibility as separate but connected systems to the main architecture.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Core Components
    subgraph Core
        BetterAutocastVPE["BetterAutocastVPE Core"]:::core
        PsycastHandler["PsycastingHandler"]:::core
        Settings["Settings System"]:::core
    end

    %% Helper System
    subgraph Helpers
        AreaHelper["Area Helper"]:::helper
        EnchantHelper["Enchant Helper"]:::helper
        MendHelper["Mend Helper"]:::helper
        PawnHelper["Pawn Helper"]:::helper
        ThingHelper["Thing Helper"]:::helper
        WeatherHelper["Weather Helper"]:::helper
    end

    %% Patch System
    subgraph Patches
        AreaPatches["Area Manager Patches"]:::patch
        PawnPatches["Pawn Patches"]:::patch
        AutocastPatches["Autocast Patches"]:::patch
    end

    %% Area System
    subgraph Areas
        CraftTimeskip["CraftTimeskip"]:::area
        GreaterRuneCircle["GreaterRuneCircle"]:::area
        IceCrystal["IceCrystal"]:::area
        RuneCircle["RuneCircle"]:::area
        SolarPinhole["SolarPinhole"]:::area
    end

    %% Version Compatibility
    subgraph Compatibility
        V14["1.4 Support"]:::version
        V15["1.5 Support"]:::version
        ModCompat["Mod Compatibility"]:::version
    end

    %% Job System
    subgraph Jobs
        JobDefs["Job Definitions"]:::job
        JobDriver["Job Driver"]:::job
    end

    %% Localization
    subgraph Localization
        EnglishTrans["English Translations"]:::local
        SettingsLocal["Settings Localization"]:::local
        AreasLocal["Areas Localization"]:::local
    end

    %% Settings UI
    subgraph SettingsUI
        SettingsWindow["Settings Window"]:::ui
        BlockedJobsWindow["Blocked Jobs Window"]:::ui
        MentalStateWindow["Mental State Window"]:::ui
    end

    %% Relationships
    BetterAutocastVPE --> PsycastHandler
    BetterAutocastVPE --> Settings
    PsycastHandler --> Helpers
    PsycastHandler --> Areas
    Settings --> SettingsUI
    BetterAutocastVPE --> Patches
    BetterAutocastVPE --> Jobs
    Settings -.-> Localization
    BetterAutocastVPE -.-> Compatibility

    %% Click Events
    click BetterAutocastVPE "https://github.com/Toby222/vpe-better-autocast/blob/main/Source/BetterAutocastVPE.cs"
    click PsycastHandler "https://github.com/Toby222/vpe-better-autocast/blob/main/Source/PsycastingHandler.cs"
    click Settings "https://github.com/Toby222/vpe-better-autocast/blob/main/Source/Settings/AutocastSettings.cs"
    click AreaHelper "https://github.com/Toby222/vpe-better-autocast/blob/main/Source/Helpers/AreaHelper.cs"
    click EnchantHelper "https://github.com/Toby222/vpe-better-autocast/blob/main/Source/Helpers/EnchantHelper.cs"
    click MendHelper "https://github.com/Toby222/vpe-better-autocast/blob/main/Source/Helpers/MendHelper.cs"
    click PawnHelper "https://github.com/Toby222/vpe-better-autocast/blob/main/Source/Helpers/PawnHelper.cs"
    click ThingHelper "https://github.com/Toby222/vpe-better-autocast/blob/main/Source/Helpers/ThingHelper.cs"
    click WeatherHelper "https://github.com/Toby222/vpe-better-autocast/blob/main/Source/Helpers/WeatherHelper.cs"
    click AreaPatches "https://github.com/Toby222/vpe-better-autocast/blob/main/Source/Patches/AreaManager_AddStartingAreas_AddAutocastAreas.cs"
    click PawnPatches "https://github.com/Toby222/vpe-better-autocast/blob/main/Source/Patches/Pawn_Tick_Autocast.cs"
    click AutocastPatches "https://github.com/Toby222/vpe-better-autocast/blob/main/Source/Patches/CanAutoCast_EnableHandledPsycasts.cs"
    click CraftTimeskip "https://github.com/Toby222/vpe-better-autocast/blob/main/Source/Area/Area_CraftTimeskip.cs"
    click GreaterRuneCircle "https://github.com/Toby222/vpe-better-autocast/blob/main/Source/Area/Area_GreaterRuneCircle.cs"
    click IceCrystal "https://github.com/Toby222/vpe-better-autocast/blob/main/Source/Area/Area_IceCrystal.cs"
    click RuneCircle "https://github.com/Toby222/vpe-better-autocast/blob/main/Source/Area/Area_RuneCircle.cs"
    click SolarPinhole "https://github.com/Toby222/vpe-better-autocast/blob/main/Source/Area/Area_SolarPinhole.cs"
    click JobDefs "https://github.com/Toby222/vpe-better-autocast/blob/main/1.4/Defs/JobDefs.xml"
    click JobDriver "https://github.com/Toby222/vpe-better-autocast/blob/main/Source/JobDrivers/JobDriver_GotoLocationAndCastAbilityOnce.cs"
    click V14 "https://github.com/Toby222/vpe-better-autocast/blob/main/1.4"
    click V15 "https://github.com/Toby222/vpe-better-autocast/blob/main/1.5"
    click ModCompat "https://github.com/Toby222/vpe-better-autocast/tree/main/Compatibility"
    click SettingsLocal "https://github.com/Toby222/vpe-better-autocast/blob/main/1.4/Languages/English/Keyed/Settings.xml"
    click AreasLocal "https://github.com/Toby222/vpe-better-autocast/blob/main/1.4/Languages/English/Keyed/Areas.xml"
    click SettingsWindow "https://github.com/Toby222/vpe-better-autocast/blob/main/Source/Settings/AutocastSettingsWindow.cs"
    click BlockedJobsWindow "https://github.com/Toby222/vpe-better-autocast/blob/main/Source/Settings/Windows/BlockedJobsListWindow.cs"
    click MentalStateWindow "https://github.com/Toby222/vpe-better-autocast/blob/main/Source/Settings/Windows/IgnoredMentalStateListWindow.cs"

    %% Styles
    classDef core fill:#a2d2ff,stroke:#333,stroke-width:2px
    classDef helper fill:#95d5b2,stroke:#333
    classDef patch fill:#ffb4a2,stroke:#333
    classDef area fill:#b5838d,stroke:#333
    classDef version fill:#e5989b,stroke:#333
    classDef job fill:#ffcdb2,stroke:#333
    classDef local fill:#ddbea9,stroke:#333
    classDef ui fill:#cb997e,stroke:#333
```
