# matthew12045/grow-a-garden architecture

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

- Interactive diagram: https://gitdiagram.com/matthew12045/grow-a-garden
- Repository: https://github.com/matthew12045/grow-a-garden

## Overview

1. **Repository shape and runtime split**
   - This is a C++17/SFML 3.x game with a clear separation between **simulation logic** and **presentation/UI**.
   - The runtime entry point is `src/main.cpp`, which feeds into either the **title flow** (`src/title/`) or the **gameplay flow** (`src/game/` + `src/core/` + `src/world/`).

2. **Two major app states: title screen vs gameplay**
   - `src/title/` contains the standalone title/credits experience (`TitleScreenApp`, `TitleScreen`, `CreditsScreen`, `Button`).
   - `src/game/` contains the actual farming game screen and overlays (`GameScreen`, `InventoryOverlay`, `ShopOverlay`).
   - This split matters architecturally: the title screen is not just a menu widget; it is a separate application state with its own UI and navigation path into gameplay.

3. **Core simulation loop**
   - `src/core/` holds the central game state and tick orchestration: `Game`, `Player`, and `TickSystem`.
   - `Game` is the hub that ties together the world, inventory/shop systems, UI, audio, and save/session state.
   - `TickSystem` drives time-based progression for crop growth, weather timing, and offline-fast-forward behavior after loading saves.

4. **World model and spatial ownership**
   - `src/world/` models the garden as a fixed grid of `Cell` objects inside `Garden`.
   - The garden is a small board (README says 5x4), and each cell can own at most one plant.
   - `Cell` uses `std::unique_ptr<Plant>` ownership, which is an important boundary: plants live inside the world grid and are not shared objects.

5. **Plant and mutation domain**
   - `src/entities/` contains the crop runtime objects: `Plant`, `Mutation`, and `HarvestedItem`.
   - `Plant` is the main mutable state machine for crop growth, harvestability, and regrowth behavior.
   - Mutations are part of the plant domain rather than the UI or inventory domain; weather and events alter plant state, and sale value is derived from that state.

6. **Items, tools, and polymorphic behavior**
   - `src/items/` defines the item hierarchy: `Item` as the abstract base, with `Seed`, `Tool`, and tool subclasses like `WateringCan` and `FertilizerTool`.
   - This is one of the main object-oriented seams in the project: inventory, shop, and gameplay all work through item polymorphism and cloning/value semantics.
   - Tools have durability and effect-specific behavior, while seeds are consumed into plants when planted.

7. **Inventory, shop, and the economy loop**
   - `src/systems/Inventory`, `Shop`, and `src/game/ShopData.h` implement the economy boundary.
   - The player loop is: buy seeds/tools, plant, grow, harvest, store in basket, sell for sheckles, reinvest.
   - `Inventory` is map-based for item counts, while harvested crops are handled separately via the harvest basket before sale.

8. **Weather and random events as world modifiers**
   - `src/world/WeatherSystem` changes over time and affects growth and mutation outcomes.
   - `src/systems/RandomEventManager` and `RaccoonEvent` provide the random-event layer that can disrupt the garden.
   - Architecturally, weather is a deterministic time-based world system, while random events are a separate event pipeline that can mutate or remove plant state.

9. **UI, rendering, and audio**
   - `src/ui/` contains cross-cutting presentation services: `UIManager`, `DrawUtils`, and `AudioManager`.
   - Rendering is split between game-specific render helpers like `CropRenderer` and general UI overlays.
   - Audio is handled centrally rather than inside gameplay objects, which keeps music/FX decisions out of simulation classes and makes weather-appropriate background music a UI-layer concern.

10. **Session persistence and offline progress**
   - `src/game/SessionManager` is the save/load boundary, backed by `nlohmann/json`.
   - The saved state includes player currency, inventory, plants, mutations, tick count, initialization state, timestamp, and harvest basket.
   - On load, the session manager and tick logic cooperate to compute offline progress from the saved timestamp and advance the simulation accordingly.

11. **Data flow through the game**
   - Input starts in SFML window/UI handlers, passes through title/game screens, and ends up as actions on `Game`, `Player`, `Inventory`, `Garden`, or `Shop`.
   - Simulation updates flow outward from `TickSystem` into `Plant`, `WeatherSystem`, and random events, then back into the UI through rendered state and overlays.
   - This creates a clean “input → state mutation → render/audio output” loop with persistence sitting beside the core state rather than inside the UI.

12. **Testing and integration boundaries**
   - `tests/` is extensive and maps closely to the architecture: cells/garden, events, inventory/shop, items, mutations, plant logic, tools/factory, UI/audio, weather, and integration coverage.
   - The presence of tests for core classes suggests the repo intentionally keeps the simulation layer testable without launching the SFML game window.
   - `tests/helpers/ConcreteClasses.h` also implies the project uses helper concrete implementations to exercise abstract item/event behavior.

13. **Build, assets, and operational concerns**
   - The project is built with CMake and targets Windows/Linux.
   - Static assets are organized separately under `assets/` for textures, audio, and fonts, and runtime behavior depends on relative asset paths from the project root.
   - `docs/class_diagram.puml` is the primary design reference for class relationships, while GitHub Actions CI enforces the build/test pipeline.

Main entry points: [`src/core/Game.h`](https://github.com/matthew12045/grow-a-garden/blob/main/src/core/Game.h) (Game), [`src/game/GameScreen.h`](https://github.com/matthew12045/grow-a-garden/blob/main/src/game/GameScreen.h) (Game Screen), [`src/game/SessionManager.h`](https://github.com/matthew12045/grow-a-garden/blob/main/src/game/SessionManager.h) (Session), [`src/entities/Plant.h`](https://github.com/matthew12045/grow-a-garden/blob/main/src/entities/Plant.h) (Plant)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_main(("Main<br/>entrypoint<br/>[main.cpp]"))
end

subgraph group_presentation["Presentation"]
  node_title_app["Title App<br/>title state<br/>[TitleScreenApp.h]"]
  node_title_screen["Title Screen<br/>menu ui<br/>[TitleScreen.h]"]
  node_credits_screen["Credits<br/>menu ui<br/>[CreditsScreen.h]"]
  node_button["Button<br/>ui control<br/>[Button.h]"]
  node_game_screen["Game Screen<br/>game state<br/>[GameScreen.h]"]
  node_inventory_overlay["Inventory UI<br/>overlay<br/>[InventoryOverlay.h]"]
  node_shop_overlay["Shop UI<br/>overlay<br/>[ShopOverlay.h]"]
  node_crop_renderer["Crop Renderer<br/>render helper<br/>[CropRenderer.h]"]
  node_ui_manager["UI Manager<br/>ui service<br/>[UIManager.h]"]
  node_audio_manager["Audio<br/>[AudioManager.h]"]
end

subgraph group_simulation["Simulation"]
  node_game["Game<br/>app core<br/>[Game.h]"]
  node_player(("Player<br/>domain state<br/>[Player.h]"))
  node_tick_system(("Tick System<br/>time loop<br/>[TickSystem.h]"))
  node_garden[("Garden<br/>world grid<br/>[Garden.h]")]
  node_cell["Cell<br/>world slot<br/>[Cell.h]"]
  node_weather(("Weather<br/>world system<br/>[WeatherSystem.h]"))
  node_plant["Plant<br/>crop state<br/>[Plant.h]"]
  node_mutation{{"Mutation<br/>crop modifier<br/>[Mutation.h]"}}
  node_harvested_item["Harvested Item<br/>crop product<br/>[HarvestedItem.h]"]
  node_item["Item<br/>abstract base<br/>[Item.h]"]
  node_seed["Seed<br/>consumable item<br/>[Seed.h]"]
  node_tool["Tool<br/>durable item<br/>[Tool.h]"]
  node_watering_can["Watering Can<br/>tool<br/>[WateringCan.h]"]
  node_fertilizer_tool["Fertilizer<br/>tool<br/>[FertilizerTool.h]"]
  node_shovel_tool["Shovel<br/>tool<br/>[ShovelTool.h]"]
  node_inventory[("Inventory<br/>storage system<br/>[Inventory.h]")]
  node_shop["Shop<br/>economy system<br/>[Shop.h]"]
  node_random_events(("Events<br/>event manager"))
  node_raccoon_event{{"Raccoon Event<br/>[RaccoonEvent.h]"}}
  node_session_manager["Session<br/>save/load<br/>[SessionManager.h]"]
  node_plant_factory["Plant Factory<br/>construction helper<br/>[PlantFactory.h]"]
  node_shop_data["Shop Data<br/>data table<br/>[ShopData.h]"]
  node_harvest_basket["Basket<br/>temporary storage<br/>[HarvestBasket.h]"]
end

node_main -->|"starts"| node_title_app
node_main -->|"starts"| node_game
node_title_app -->|"hosts"| node_title_screen
node_title_screen -->|"navigates"| node_credits_screen
node_title_screen -->|"uses"| node_button
node_game -->|"owns"| node_player
node_game -->|"drives"| node_tick_system
node_game -->|"contains"| node_garden
node_game -->|"tracks"| node_inventory
node_game -->|"economy"| node_shop
node_game -->|"persists"| node_session_manager
node_game -->|"coordinates"| node_ui_manager
node_game -->|"plays"| node_audio_manager
node_game_screen -->|"binds to"| node_game
node_game_screen -->|"renders"| node_crop_renderer
node_game_screen -->|"shows"| node_inventory_overlay
node_game_screen -->|"shows"| node_shop_overlay
node_game_screen -->|"uses"| node_ui_manager
node_game_screen -->|"uses"| node_audio_manager
node_garden -->|"contains"| node_cell
node_cell -->|"owns"| node_plant
node_plant -->|"modifies"| node_mutation
node_plant -->|"produces"| node_harvested_item
node_tick_system -->|"advances"| node_plant
node_tick_system -->|"updates"| node_weather
node_tick_system -->|"triggers"| node_random_events
node_weather -->|"affects"| node_plant
node_random_events -->|"includes"| node_raccoon_event
node_inventory -->|"stores"| node_item
node_seed -->|"inherits"| node_item
node_tool -->|"inherits"| node_item
node_watering_can -->|"inherits"| node_tool
node_fertilizer_tool -->|"inherits"| node_tool
node_shovel_tool -->|"inherits"| node_tool
node_shop -->|"configures"| node_shop_data
node_shop -->|"trades"| node_item
node_session_manager -->|"saves"| node_player
node_session_manager -->|"saves"| node_inventory
node_session_manager -->|"saves"| node_garden
node_session_manager -->|"restores"| node_tick_system
node_session_manager -->|"saves"| node_harvest_basket
node_plant_factory -->|"creates"| node_plant
node_harvest_basket -->|"holds"| node_harvested_item

click node_main "https://github.com/matthew12045/grow-a-garden/blob/main/src/main.cpp"
click node_title_app "https://github.com/matthew12045/grow-a-garden/blob/main/src/title/TitleScreenApp.h"
click node_title_screen "https://github.com/matthew12045/grow-a-garden/blob/main/src/title/TitleScreen.h"
click node_credits_screen "https://github.com/matthew12045/grow-a-garden/blob/main/src/title/CreditsScreen.h"
click node_button "https://github.com/matthew12045/grow-a-garden/blob/main/src/title/Button.h"
click node_game_screen "https://github.com/matthew12045/grow-a-garden/blob/main/src/game/GameScreen.h"
click node_inventory_overlay "https://github.com/matthew12045/grow-a-garden/blob/main/src/game/InventoryOverlay.h"
click node_shop_overlay "https://github.com/matthew12045/grow-a-garden/blob/main/src/game/ShopOverlay.h"
click node_crop_renderer "https://github.com/matthew12045/grow-a-garden/blob/main/src/game/CropRenderer.h"
click node_ui_manager "https://github.com/matthew12045/grow-a-garden/blob/main/src/ui/UIManager.h"
click node_audio_manager "https://github.com/matthew12045/grow-a-garden/blob/main/src/ui/AudioManager.h"
click node_game "https://github.com/matthew12045/grow-a-garden/blob/main/src/core/Game.h"
click node_player "https://github.com/matthew12045/grow-a-garden/blob/main/src/core/Player.h"
click node_tick_system "https://github.com/matthew12045/grow-a-garden/blob/main/src/core/TickSystem.h"
click node_garden "https://github.com/matthew12045/grow-a-garden/blob/main/src/world/Garden.h"
click node_cell "https://github.com/matthew12045/grow-a-garden/blob/main/src/world/Cell.h"
click node_weather "https://github.com/matthew12045/grow-a-garden/blob/main/src/world/WeatherSystem.h"
click node_plant "https://github.com/matthew12045/grow-a-garden/blob/main/src/entities/Plant.h"
click node_mutation "https://github.com/matthew12045/grow-a-garden/blob/main/src/entities/Mutation.h"
click node_harvested_item "https://github.com/matthew12045/grow-a-garden/blob/main/src/entities/HarvestedItem.h"
click node_item "https://github.com/matthew12045/grow-a-garden/blob/main/src/items/Item.h"
click node_seed "https://github.com/matthew12045/grow-a-garden/blob/main/src/items/Seed.h"
click node_tool "https://github.com/matthew12045/grow-a-garden/blob/main/src/items/Tool.h"
click node_watering_can "https://github.com/matthew12045/grow-a-garden/blob/main/src/items/WateringCan.h"
click node_fertilizer_tool "https://github.com/matthew12045/grow-a-garden/blob/main/src/items/FertilizerTool.h"
click node_shovel_tool "https://github.com/matthew12045/grow-a-garden/blob/main/src/items/ShovelTool.h"
click node_inventory "https://github.com/matthew12045/grow-a-garden/blob/main/src/systems/Inventory.h"
click node_shop "https://github.com/matthew12045/grow-a-garden/blob/main/src/systems/Shop.h"
click node_random_events "https://github.com/matthew12045/grow-a-garden/blob/main/src/systems/RandomEventManager.h"
click node_raccoon_event "https://github.com/matthew12045/grow-a-garden/blob/main/src/systems/RaccoonEvent.h"
click node_session_manager "https://github.com/matthew12045/grow-a-garden/blob/main/src/game/SessionManager.h"
click node_plant_factory "https://github.com/matthew12045/grow-a-garden/blob/main/src/game/PlantFactory.h"
click node_shop_data "https://github.com/matthew12045/grow-a-garden/blob/main/src/game/ShopData.h"
click node_harvest_basket "https://github.com/matthew12045/grow-a-garden/blob/main/src/game/HarvestBasket.h"

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_main toneBlue
class node_title_app,node_title_screen,node_credits_screen,node_button,node_game_screen,node_inventory_overlay,node_shop_overlay,node_crop_renderer,node_ui_manager,node_audio_manager toneAmber
class node_game,node_player,node_tick_system,node_garden,node_cell,node_weather,node_plant,node_mutation,node_harvested_item,node_item,node_seed,node_tool,node_watering_can,node_fertilizer_tool,node_shovel_tool,node_inventory,node_shop,node_random_events,node_raccoon_event,node_session_manager,node_plant_factory,node_shop_data,node_harvest_basket toneMint
```

## Components

### Runtime

Application entry and top-level state routing

- [Main](https://github.com/matthew12045/grow-a-garden/blob/main/src/main.cpp): entrypoint · Launches the application and selects the top-level flow · `src/main.cpp`

### Presentation

Title flow, game screens, rendering, and audio

- [Title App](https://github.com/matthew12045/grow-a-garden/blob/main/src/title/TitleScreenApp.h): title state · Owns the title-screen application flow and navigation · `src/title/TitleScreenApp.h`
- [Title Screen](https://github.com/matthew12045/grow-a-garden/blob/main/src/title/TitleScreen.h): menu ui · Primary title screen and navigation surface · `src/title/TitleScreen.h`
- [Credits](https://github.com/matthew12045/grow-a-garden/blob/main/src/title/CreditsScreen.h): menu ui · Credits view within the title experience · `src/title/CreditsScreen.h`
- [Button](https://github.com/matthew12045/grow-a-garden/blob/main/src/title/Button.h): ui control · Reusable title-screen interaction control · `src/title/Button.h`
- [Game Screen](https://github.com/matthew12045/grow-a-garden/blob/main/src/game/GameScreen.h): game state · Main gameplay presentation and screen orchestration · `src/game/GameScreen.h`
- [Inventory UI](https://github.com/matthew12045/grow-a-garden/blob/main/src/game/InventoryOverlay.h): overlay · Gameplay overlay for inventory actions and counts · `src/game/InventoryOverlay.h`
- [Shop UI](https://github.com/matthew12045/grow-a-garden/blob/main/src/game/ShopOverlay.h): overlay · Gameplay overlay for buying and selling goods · `src/game/ShopOverlay.h`
- [Crop Renderer](https://github.com/matthew12045/grow-a-garden/blob/main/src/game/CropRenderer.h): render helper · Draws plants and crop visual state · `src/game/CropRenderer.h`
- [UI Manager](https://github.com/matthew12045/grow-a-garden/blob/main/src/ui/UIManager.h): ui service · Coordinates shared UI behavior and overlay presentation · `src/ui/UIManager.h`
- [Audio](https://github.com/matthew12045/grow-a-garden/blob/main/src/ui/AudioManager.h): audio service · Centralized music and sound playback · `src/ui/AudioManager.h`

### Simulation

Core state, world model, plants, items, and systems

- [Game](https://github.com/matthew12045/grow-a-garden/blob/main/src/core/Game.h): app core · Central gameplay hub connecting state, systems, and persistence · `src/core/Game.h`
- [Player](https://github.com/matthew12045/grow-a-garden/blob/main/src/core/Player.h): domain state · Player currency and progression state · `src/core/Player.h`
- [Tick System](https://github.com/matthew12045/grow-a-garden/blob/main/src/core/TickSystem.h): time loop · Advances simulation time, growth, weather, and offline progress · `src/core/TickSystem.h`
- [Garden](https://github.com/matthew12045/grow-a-garden/blob/main/src/world/Garden.h): world grid · Fixed grid of cells that owns the garden layout · `src/world/Garden.h`
- [Cell](https://github.com/matthew12045/grow-a-garden/blob/main/src/world/Cell.h): world slot · Single garden slot with unique plant ownership · `src/world/Cell.h`
- [Weather](https://github.com/matthew12045/grow-a-garden/blob/main/src/world/WeatherSystem.h): world system · Time-based weather changes that affect growth and mutations · `src/world/WeatherSystem.h`
- [Plant](https://github.com/matthew12045/grow-a-garden/blob/main/src/entities/Plant.h): crop state · Mutable crop lifecycle, harvestability, and regrowth · `src/entities/Plant.h`
- [Mutation](https://github.com/matthew12045/grow-a-garden/blob/main/src/entities/Mutation.h): crop modifier · Plant mutation state and value-affecting modifiers · `src/entities/Mutation.h`
- [Harvested Item](https://github.com/matthew12045/grow-a-garden/blob/main/src/entities/HarvestedItem.h): crop product · Harvest result used before sale or storage · `src/entities/HarvestedItem.h`
- [Item](https://github.com/matthew12045/grow-a-garden/blob/main/src/items/Item.h): abstract base · Polymorphic base for seeds and tools · `src/items/Item.h`
- [Seed](https://github.com/matthew12045/grow-a-garden/blob/main/src/items/Seed.h): consumable item · Plantable item converted into crops · `src/items/Seed.h`
- [Tool](https://github.com/matthew12045/grow-a-garden/blob/main/src/items/Tool.h): durable item · Base class for farm tools with durability and effects · `src/items/Tool.h`
- [Watering Can](https://github.com/matthew12045/grow-a-garden/blob/main/src/items/WateringCan.h): tool · Watering tool used to influence crop growth · `src/items/WateringCan.h`
- [Fertilizer](https://github.com/matthew12045/grow-a-garden/blob/main/src/items/FertilizerTool.h): tool · Growth or yield modifying tool · `src/items/FertilizerTool.h`
- [Shovel](https://github.com/matthew12045/grow-a-garden/blob/main/src/items/ShovelTool.h): tool · Digging or removal tool for the garden · `src/items/ShovelTool.h`
- [Inventory](https://github.com/matthew12045/grow-a-garden/blob/main/src/systems/Inventory.h): storage system · Map-based item counts and ownership tracking · `src/systems/Inventory.h`
- [Shop](https://github.com/matthew12045/grow-a-garden/blob/main/src/systems/Shop.h): economy system · Buying and selling rules for the farm economy · `src/systems/Shop.h`
- [Events](https://github.com/matthew12045/grow-a-garden/blob/main/src/systems/RandomEventManager.h): event manager · Random event pipeline that can disrupt the garden · `src/systems/RandomEventManager.h`
- [Raccoon Event](https://github.com/matthew12045/grow-a-garden/blob/main/src/systems/RaccoonEvent.h): event · Concrete disruptive event implementation · `src/systems/RaccoonEvent.h`
- [Session](https://github.com/matthew12045/grow-a-garden/blob/main/src/game/SessionManager.h): save/load · Save and load boundary with offline progress support · `src/game/SessionManager.h`
- [Plant Factory](https://github.com/matthew12045/grow-a-garden/blob/main/src/game/PlantFactory.h): construction helper · Builds plant instances from gameplay data · `src/game/PlantFactory.h`
- [Shop Data](https://github.com/matthew12045/grow-a-garden/blob/main/src/game/ShopData.h): data table · Static shop configuration used by gameplay · `src/game/ShopData.h`
- [Basket](https://github.com/matthew12045/grow-a-garden/blob/main/src/game/HarvestBasket.h): temporary storage · Intermediate storage for harvested crops before sale · `src/game/HarvestBasket.h`

## Connections

- Main → Title App: starts · Launch path into the title flow
- Main → Game: starts · Launch path into the gameplay flow
- Title App → Title Screen: hosts · Title app presents the main title screen
- Title Screen → Credits: navigates · Title flow can open the credits screen
- Title Screen → Button: uses · Title UI is built from button controls
- Game → Player: owns · Game hub owns player progression state
- Game → Tick System: drives · Game hub advances simulation through ticks
- Game → Garden: contains · Gameplay operates on the garden world
- Game → Inventory: tracks · Game keeps item ownership and counts
- Game → Shop: economy · Game routes buy/sell interactions through shop logic
- Game → Session: persists · Save/load boundary for gameplay state
- Game → UI Manager: coordinates · Game uses shared UI coordination services
- Game → Audio: plays · Game routes music and sound through central audio
- Game Screen → Game: binds to · Main gameplay screen reflects core game state
- Game Screen → Crop Renderer: renders · Gameplay screen delegates crop drawing
- Game Screen → Inventory UI: shows · Gameplay screen presents inventory overlay
- Game Screen → Shop UI: shows · Gameplay screen presents shop overlay
- Game Screen → UI Manager: uses · Gameplay screen uses shared UI services
- Game Screen → Audio: uses · Gameplay screen triggers centralized audio
- Garden → Cell: contains · Garden is composed of owned cells
- Cell → Plant: owns · Each cell uniquely owns at most one plant
- Plant → Mutation: modifies · Plant state incorporates mutation effects
- Plant → Harvested Item: produces · Harvesting yields a crop product
- Tick System → Plant: advances · Tick updates growth and harvest state
- Tick System → Weather: updates · Tick progression drives weather changes
- Tick System → Events: triggers · Time progression can invoke random events
- Weather → Plant: affects · Weather influences growth and mutation outcomes
- Events → Raccoon Event: includes · Event manager runs concrete event types
- Inventory → Item: stores · Inventory tracks polymorphic item counts
- Seed → Item: inherits · Seeds are one item specialization
- Tool → Item: inherits · Tools are one item specialization
- Watering Can → Tool: inherits · Watering can extends tool behavior
- Fertilizer → Tool: inherits · Fertilizer extends tool behavior
- Shovel → Tool: inherits · Shovel extends tool behavior
- Shop → Shop Data: configures · Shop logic is driven by static data
- Shop → Item: trades · Shop buys and sells item instances
- Session → Player: saves · Player state is serialized for sessions
- Session → Inventory: saves · Inventory is persisted across sessions
- Session → Garden: saves · Garden and plant state are persisted
- Session → Tick System: restores · Load time is used to compute offline progress
- Session → Basket: saves · Harvest basket is part of session state
- Plant Factory → Plant: creates · Factory constructs plant instances from data
- Basket → Harvested Item: holds · Basket stores harvested crop items temporarily
