# bbluesky123/mystiarecommendation architecture

> Architecture diagram of the GitHub repository bbluesky123/mystiarecommendation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bbluesky123/mystiarecommendation
- Repository: https://github.com/bbluesky123/mystiarecommendation

## Overview

MystiaRecommendation is a BepInEx IL2CPP plugin that recommends meal-and-drink combinations for rare guests. Game hooks capture guest orders and runtime budget; the plugin combines those inputs with owned recipes, stock, cookware, trends, and guest data to generate high- and low-price strategies (including fixed-quest-dish handling), then presents recommendations and tracks cooking, serving, and storage. The README documents capabilities beyond the sampled excerpts; those are represented at subsystem level where their implementation path is supported by the tree.

Main entry points: [`Plugin.cs`](https://github.com/bbluesky123/mystiarecommendation/blob/master/Plugin.cs) (Plugin orchestration), [`Engine/RecipeMatcher.cs`](https://github.com/bbluesky123/mystiarecommendation/blob/master/Engine/RecipeMatcher.cs) (Recommendation matching), [`Patches/CustomerPatch.cs`](https://github.com/bbluesky123/mystiarecommendation/blob/master/Patches/CustomerPatch.cs) (Guest order hooks), [`Engine/RuntimeOrderTracker.cs`](https://github.com/bbluesky123/mystiarecommendation/blob/master/Engine/RuntimeOrderTracker.cs) (Dish lifecycle tracker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_integration["Game integration"]
  node_plugin["Plugin orchestration<br/>[Plugin.cs]"]
  node_customer_hooks["Guest order hooks<br/>[CustomerPatch.cs]"]
  node_cooker_hooks["Cooking hooks<br/>[CookerPatch.cs]"]
  node_plugin_info["Plugin identity<br/>[MyPluginInfo.cs]"]
end

subgraph group_engine["Recommendation engine"]
  node_config["Plugin settings<br/>[PluginConfig.cs]"]
  node_customer_data["Guest data"]
  node_budget["Budget rules"]
  node_matcher["Recommendation matching<br/>[RecipeMatcher.cs]"]
  node_state_cache["Runtime state snapshot<br/>[GameStateCache.cs]"]
  node_json["JSON parser<br/>[SimpleJson.cs]"]
end

subgraph group_tracking["Order tracking"]
  node_order_tracker["Dish lifecycle tracker"]
  node_seat_policy["Seat marker policy"]
end

subgraph group_presentation["Presentation and data"]
  node_gui["Overlay lifecycle<br/>[GUIBehaviour.cs]"]
  node_overlay["Recommendation cards<br/>[OverlayRenderer.cs]"]
  node_customer_json["Guest records"]
  node_recipes_json["Recipe catalogue<br/>[recipes.json]"]
  node_beverages_json["Beverage catalogue<br/>[beverages.json]"]
  node_ingredients_json["Ingredient catalogue<br/>[ingredients.json]"]
end

node_game(("Game runtime"))
node_player(("Player"))

node_game -->|"provides order events"| node_customer_hooks
node_customer_hooks -->|"updates guest state"| node_plugin
node_customer_hooks -->|"reads order budget"| node_budget
node_plugin -->|"queries guest data"| node_customer_data
node_plugin -->|"orchestrates matching"| node_matcher
node_plugin -->|"uses settings"| node_config
node_plugin -->|"registers hooks"| node_customer_hooks
node_plugin -->|"registers hooks"| node_cooker_hooks
node_plugin -->|"coordinates tracking"| node_order_tracker
node_plugin -->|"starts overlay"| node_gui
node_customer_data -->|"parses records"| node_json
node_matcher -->|"uses guest preferences"| node_customer_data
node_matcher -->|"filters by budget"| node_budget
node_matcher -->|"reads recommendation options"| node_config
node_matcher -->|"uses recommendation state"| node_plugin
node_game -.->|"supplies runtime state"| node_state_cache
node_plugin -->|"captures snapshot"| node_state_cache
node_customer_json -->|"loads guest records"| node_customer_data
node_recipes_json -->|"supplies recipes"| node_matcher
node_beverages_json -->|"supplies beverages"| node_matcher
node_ingredients_json -->|"supplies ingredients"| node_matcher
node_cooker_hooks -->|"reports cooking events"| node_order_tracker
node_order_tracker -->|"updates recommendation status"| node_plugin
node_order_tracker -.->|"uses seat policy"| node_seat_policy
node_gui -->|"renders cards"| node_overlay
node_gui -->|"reads active recommendations"| node_plugin
node_overlay -->|"displays recommendations"| node_plugin
node_player -->|"interacts with cards"| node_overlay
node_plugin -->|"uses identity constants"| node_plugin_info

click node_plugin "https://github.com/bbluesky123/mystiarecommendation/blob/master/Plugin.cs"
click node_customer_hooks "https://github.com/bbluesky123/mystiarecommendation/blob/master/Patches/CustomerPatch.cs"
click node_cooker_hooks "https://github.com/bbluesky123/mystiarecommendation/blob/master/Patches/CookerPatch.cs"
click node_config "https://github.com/bbluesky123/mystiarecommendation/blob/master/Config/PluginConfig.cs"
click node_customer_data "https://github.com/bbluesky123/mystiarecommendation/blob/master/Engine/CustomerDataEngine.cs"
click node_budget "https://github.com/bbluesky123/mystiarecommendation/blob/master/Engine/OrderBudgetContext.cs"
click node_matcher "https://github.com/bbluesky123/mystiarecommendation/blob/master/Engine/RecipeMatcher.cs"
click node_state_cache "https://github.com/bbluesky123/mystiarecommendation/blob/master/Engine/GameStateCache.cs"
click node_json "https://github.com/bbluesky123/mystiarecommendation/blob/master/Engine/SimpleJson.cs"
click node_order_tracker "https://github.com/bbluesky123/mystiarecommendation/blob/master/Engine/RuntimeOrderTracker.cs"
click node_seat_policy "https://github.com/bbluesky123/mystiarecommendation/blob/master/Engine/SeatMarkerPolicy.cs"
click node_gui "https://github.com/bbluesky123/mystiarecommendation/blob/master/UI/GUIBehaviour.cs"
click node_overlay "https://github.com/bbluesky123/mystiarecommendation/blob/master/UI/OverlayRenderer.cs"
click node_customer_json "https://github.com/bbluesky123/mystiarecommendation/blob/master/Data/customers_rare.json"
click node_recipes_json "https://github.com/bbluesky123/mystiarecommendation/blob/master/Data/recipes.json"
click node_beverages_json "https://github.com/bbluesky123/mystiarecommendation/blob/master/Data/beverages.json"
click node_ingredients_json "https://github.com/bbluesky123/mystiarecommendation/blob/master/Data/ingredients.json"
click node_plugin_info "https://github.com/bbluesky123/mystiarecommendation/blob/master/MyPluginInfo.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_plugin,node_customer_hooks,node_cooker_hooks,node_plugin_info toneBlue
class node_config,node_customer_data,node_budget,node_matcher,node_state_cache,node_json toneAmber
class node_order_tracker,node_seat_policy toneMint
class node_gui,node_overlay,node_customer_json,node_recipes_json,node_beverages_json,node_ingredients_json toneRose
class node_game,node_player toneIndigo
```

## Components

### Game integration

- [Plugin orchestration](https://github.com/bbluesky123/mystiarecommendation/blob/master/Plugin.cs): `Plugin.cs`
- [Guest order hooks](https://github.com/bbluesky123/mystiarecommendation/blob/master/Patches/CustomerPatch.cs): `Patches/CustomerPatch.cs`
- [Cooking hooks](https://github.com/bbluesky123/mystiarecommendation/blob/master/Patches/CookerPatch.cs): `Patches/CookerPatch.cs`
- [Plugin identity](https://github.com/bbluesky123/mystiarecommendation/blob/master/MyPluginInfo.cs): `MyPluginInfo.cs`

### Recommendation engine

- [Plugin settings](https://github.com/bbluesky123/mystiarecommendation/blob/master/Config/PluginConfig.cs): `Config/PluginConfig.cs`
- [Guest data](https://github.com/bbluesky123/mystiarecommendation/blob/master/Engine/CustomerDataEngine.cs): `Engine/CustomerDataEngine.cs`
- [Budget rules](https://github.com/bbluesky123/mystiarecommendation/blob/master/Engine/OrderBudgetContext.cs): `Engine/OrderBudgetContext.cs`
- [Recommendation matching](https://github.com/bbluesky123/mystiarecommendation/blob/master/Engine/RecipeMatcher.cs): `Engine/RecipeMatcher.cs`
- [Runtime state snapshot](https://github.com/bbluesky123/mystiarecommendation/blob/master/Engine/GameStateCache.cs): `Engine/GameStateCache.cs`
- [JSON parser](https://github.com/bbluesky123/mystiarecommendation/blob/master/Engine/SimpleJson.cs): `Engine/SimpleJson.cs`

### Order tracking

- [Dish lifecycle tracker](https://github.com/bbluesky123/mystiarecommendation/blob/master/Engine/RuntimeOrderTracker.cs): `Engine/RuntimeOrderTracker.cs`
- [Seat marker policy](https://github.com/bbluesky123/mystiarecommendation/blob/master/Engine/SeatMarkerPolicy.cs): `Engine/SeatMarkerPolicy.cs`

### Presentation and data

- [Overlay lifecycle](https://github.com/bbluesky123/mystiarecommendation/blob/master/UI/GUIBehaviour.cs): `UI/GUIBehaviour.cs`
- [Recommendation cards](https://github.com/bbluesky123/mystiarecommendation/blob/master/UI/OverlayRenderer.cs): `UI/OverlayRenderer.cs`
- [Guest records](https://github.com/bbluesky123/mystiarecommendation/blob/master/Data/customers_rare.json): `Data/customers_rare.json`
- [Recipe catalogue](https://github.com/bbluesky123/mystiarecommendation/blob/master/Data/recipes.json): `Data/recipes.json`
- [Beverage catalogue](https://github.com/bbluesky123/mystiarecommendation/blob/master/Data/beverages.json): `Data/beverages.json`
- [Ingredient catalogue](https://github.com/bbluesky123/mystiarecommendation/blob/master/Data/ingredients.json): `Data/ingredients.json`

### Other components

- **Game runtime**
- **Player**

## Connections

- Game runtime → Guest order hooks: provides order events (evidence: `README.md`)
- Guest order hooks → Plugin orchestration: updates guest state (evidence: `Patches/CustomerPatch.cs`)
- Guest order hooks → Budget rules: reads order budget (evidence: `Patches/CustomerPatch.cs`)
- Plugin orchestration → Guest data: queries guest data (evidence: `Plugin.cs`)
- Plugin orchestration → Recommendation matching: orchestrates matching (evidence: `Plugin.cs`)
- Plugin orchestration → Plugin settings: uses settings (evidence: `Plugin.cs`)
- Plugin orchestration → Guest order hooks: registers hooks (evidence: `Plugin.cs`)
- Plugin orchestration → Cooking hooks: registers hooks (evidence: `Plugin.cs`)
- Plugin orchestration → Dish lifecycle tracker: coordinates tracking (evidence: `Plugin.cs`)
- Plugin orchestration → Overlay lifecycle: starts overlay (evidence: `Plugin.cs`)
- Guest data → JSON parser: parses records (evidence: `Engine/CustomerDataEngine.cs`)
- Recommendation matching → Guest data: uses guest preferences (evidence: `Engine/RecipeMatcher.cs`)
- Recommendation matching → Budget rules: filters by budget (evidence: `Engine/RecipeMatcher.cs`)
- Recommendation matching → Plugin settings: reads recommendation options (evidence: `Engine/RecipeMatcher.cs`)
- Recommendation matching → Plugin orchestration: uses recommendation state (evidence: `Engine/RecipeMatcher.cs`)
- Game runtime → Runtime state snapshot: supplies runtime state
- Plugin orchestration → Runtime state snapshot: captures snapshot (evidence: `README.md`)
- Guest records → Guest data: loads guest records (evidence: `Engine/CustomerDataEngine.cs`)
- Recipe catalogue → Recommendation matching: supplies recipes (evidence: `README.md`)
- Beverage catalogue → Recommendation matching: supplies beverages (evidence: `README.md`)
- Ingredient catalogue → Recommendation matching: supplies ingredients (evidence: `README.md`)
- Cooking hooks → Dish lifecycle tracker: reports cooking events (evidence: `Patches/CookerPatch.cs`)
- Dish lifecycle tracker → Plugin orchestration: updates recommendation status (evidence: `Engine/RuntimeOrderTracker.cs`)
- Dish lifecycle tracker → Seat marker policy: uses seat policy (evidence: `Engine/RuntimeOrderTracker.cs`)
- Overlay lifecycle → Recommendation cards: renders cards (evidence: `UI/GUIBehaviour.cs`)
- Overlay lifecycle → Plugin orchestration: reads active recommendations (evidence: `UI/GUIBehaviour.cs`)
- Recommendation cards → Plugin orchestration: displays recommendations (evidence: `UI/OverlayRenderer.cs`)
- Player → Recommendation cards: interacts with cards (evidence: `README.md`)
- Plugin orchestration → Plugin identity: uses identity constants (evidence: `Plugin.cs`)
