# 0s-been/hello_world_c_cpp_adventure architecture

> Architecture diagram of the GitHub repository 0s-been/hello_world_c_cpp_adventure, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/0s-been/hello_world_c_cpp_adventure
- Repository: https://github.com/0s-been/hello_world_c_cpp_adventure

## Overview

#### Purpose and Entry Points
Unity/C# learning project centered on an inventory and equipment system using MVP and Onion Architecture. The playable composition is scene-driven; primary scene assets are `Assets/Scenes/SampleScene.unity` and `Assets/a.unity`. Inventory bootstrap/wiring is expected through `Assets/01.OnionArc/Scripts/Installer/InventoryInstaller.cs` and `Assets/01.OnionArc/Scripts/Installer/SystemInstaller.cs`.

#### Composition and Dependency Boundaries
Zenject is the dependency-injection runtime. Installers bind concrete models, applications, presenters, and views behind interfaces, keeping UI and Unity components outside core logic. Key boundary paths:
- `Assets/01.OnionArc/Scripts/Installer/InventoryInstaller.cs`
- `Assets/01.OnionArc/Scripts/Installer/SystemInstaller.cs`
- `Assets/Plugins/Zenject/Source/Main/DiContainer.cs`

The intended dependency direction is View/Presenter → application/domain SDK contracts → model/repository implementations, rather than UI directly owning inventory rules.

#### Inventory Onion Module
The inventory SDK separates domain rules, application orchestration, and file-backed repositories. Domain types represent item metadata and placement; inventory operations are exposed through interfaces and implemented in application services.
- `Assets/01.OnionArc/Submodules/InventorySDK/Domain/InventoryDomain.cs`
- `Assets/01.OnionArc/Submodules/InventorySDK/Application/InventoryApplication.cs`
- `Assets/01.OnionArc/Submodules/InventorySDK/Domain/ItemInfo.cs`

Persistent/catalog input is local packaged data, with interchangeable CSV and JSON repository adapters:
- `Assets/01.OnionArc/Submodules/InventorySDK/Infrastructure/CsvItemRepository.cs`
- `Assets/01.OnionArc/Submodules/InventorySDK/Infrastructure/JsonItemRepository.cs`
- `Assets/StreamingAssets/items.csv`

#### Equipment Onion Module
Equipment is a parallel SDK with domain and application layers, likely consuming inventory item/placement concepts through interfaces. It is insulated from presentation and Unity UI.
- `Assets/01.OnionArc/Submodules/EquipmentSDK/Domain/EquipmentDomain.cs`
- `Assets/01.OnionArc/Submodules/EquipmentSDK/Application/EquipmentApplication.cs`
- `Assets/01.OnionArc/Submodules/InventorySDK/Domain/EquipPart.cs`

#### Runtime Models and Catalog
Unity-facing models retain active inventory, equipment, and catalog state and bridge the SDK/application layers to presenters. Interfaces define the replacement seam for these state holders.
- `Assets/01.OnionArc/Scripts/Model/InventoryModel.cs`
- `Assets/01.OnionArc/Scripts/Model/EquipmentModel.cs`
- `Assets/01.OnionArc/Scripts/Model/ItemCatalogModel.cs`

#### MVP Presentation Flow
User actions originate in Unity UI views, flow to presenters, then mutate models/application services. Presenters update views through view interfaces, so drag/drop, selection, confirmation, pause, tooltip, and sprite rendering remain presentation concerns.
- `Assets/01.OnionArc/Scripts/Presenter/InventoryPresenter.cs`
- `Assets/01.OnionArc/Scripts/Presenter/EquipmentPresenter.cs`
- `Assets/01.OnionArc/Scripts/View/InventoryView.cs`

Relevant UI boundary contracts include `Assets/01.OnionArc/Scripts/Presenter/IInventoryView.cs` and `Assets/01.OnionArc/Scripts/Presenter/IEquipmentView.cs`.

#### Adjacent Gameplay Systems
The repository also contains separate Unity gameplay exercises: a player action/combat controller stack and a stat-object/arrow game module. These are adjacent to, not part of, the Onion inventory core.
- `Assets/01.Scripts/Player/PlayerController.cs`
- `Assets/01.Scripts/Player/PlayerComboAtk.cs`
- `Assets/01.MiddleExam/Presenter/Presenter.cs`

#### Platform and External Dependencies
Runtime is Unity with the Universal Render Pipeline settings under `Assets/Settings/`. Input uses Unity Input System actions at `Assets/InputSystem_Actions.inputactions`. Bundled third-party runtimes are Zenject (DI), UniRx (reactive programming), and UniTask (async); no remote backend/service is evident. Item icons are loaded from Unity Resources, notably `Assets/Resources/Items/`.

Main entry points: [`Assets/01.OnionArc/Scripts/Installer/InventoryInstaller.cs`](https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Scripts/Installer/InventoryInstaller.cs) (Inventory Installer), [`Assets/01.OnionArc/Scripts/Installer/SystemInstaller.cs`](https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Scripts/Installer/SystemInstaller.cs) (System Installer), [`Assets/01.OnionArc/Scripts/Presenter/InventoryPresenter.cs`](https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Scripts/Presenter/InventoryPresenter.cs) (Inventory Presenter), [`Assets/01.OnionArc/Submodules/InventorySDK/Infrastructure/CsvItemRepository.cs`](https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Submodules/InventorySDK/Infrastructure/CsvItemRepository.cs) (CSV Item Repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_unity["Unity Runtime"]
  node_scenes["Playable Scenes<br/>Unity scenes<br/>[SampleScene.unity]"]
  node_item_icons["Item Icons<br/>Unity Resources"]
end

subgraph group_composition["Composition"]
  node_zenject{{"Zenject Container<br/>DI runtime<br/>[DiContainer.cs]"}}
  node_inventory_installer["Inventory Installer<br/>DI installer"]
  node_system_installer["System Installer<br/>DI installer<br/>[SystemInstaller.cs]"]
end

subgraph group_inventory["Inventory Onion SDK"]
  node_inventory_domain["Inventory Domain<br/>domain contracts<br/>[InventoryDomain.cs]"]
  node_item_info["Item Metadata<br/>domain type<br/>[ItemInfo.cs]"]
  node_inventory_application["Inventory Application<br/>application service"]
  node_csv_repository["CSV Item Repository<br/>repository adapter"]
  node_json_repository["JSON Item Repository<br/>repository adapter"]
  node_item_csv["Item Catalog CSV<br/>packaged data<br/>[items.csv]"]
end

subgraph group_equipment["Equipment Onion SDK"]
  node_equipment_domain["Equipment Domain<br/>domain contracts<br/>[EquipmentDomain.cs]"]
  node_equipment_application["Equipment Application<br/>application service"]
  node_equip_part["Equipment Parts<br/>shared domain type<br/>[EquipPart.cs]"]
end

subgraph group_presentation["MVP Runtime"]
  node_inventory_model["Inventory Model<br/>Unity state model<br/>[InventoryModel.cs]"]
  node_equipment_model["Equipment Model<br/>Unity state model<br/>[EquipmentModel.cs]"]
  node_catalog_model["Item Catalog Model<br/>Unity state model"]
  node_inventory_presenter["Inventory Presenter<br/>MVP presenter"]
  node_equipment_presenter["Equipment Presenter<br/>MVP presenter"]
  node_inventory_view["Inventory View<br/>Unity UI view<br/>[InventoryView.cs]"]
  node_inventory_view_contract["Inventory View Contract<br/>MVP interface<br/>[IInventoryView.cs]"]
  node_equipment_view_contract["Equipment View Contract<br/>MVP interface<br/>[IEquipmentView.cs]"]
end

node_scenes -->|"hosts"| node_inventory_installer
node_scenes -->|"hosts"| node_system_installer
node_inventory_installer -->|"registers bindings with"| node_zenject
node_system_installer -->|"registers bindings with"| node_zenject
node_inventory_installer -->|"wires"| node_inventory_presenter
node_inventory_installer -->|"wires"| node_inventory_model
node_system_installer -->|"wires"| node_equipment_presenter
node_system_installer -->|"wires"| node_equipment_model
node_inventory_view -->|"user actions"| node_inventory_presenter
node_inventory_presenter -->|"updates through"| node_inventory_view_contract
node_inventory_presenter -->|"mutates"| node_inventory_model
node_equipment_presenter -->|"updates through"| node_equipment_view_contract
node_equipment_presenter -->|"mutates"| node_equipment_model
node_inventory_model -->|"uses"| node_inventory_application
node_equipment_model -->|"uses"| node_equipment_application
node_catalog_model -->|"loads catalog through"| node_csv_repository
node_catalog_model -->|"loads sprites from"| node_item_icons
node_inventory_application -->|"orchestrates"| node_inventory_domain
node_inventory_domain -->|"uses"| node_item_info
node_csv_repository -->|"reads"| node_item_csv
node_json_repository -->|"maps"| node_item_info
node_csv_repository -->|"maps"| node_item_info
node_equipment_application -->|"orchestrates"| node_equipment_domain
node_equipment_domain -->|"uses"| node_equip_part
node_equipment_domain -.->|"consumes inventory concepts"| node_inventory_domain

click node_scenes "https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/Scenes/SampleScene.unity"
click node_zenject "https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/Plugins/Zenject/Source/Main/DiContainer.cs"
click node_inventory_installer "https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Scripts/Installer/InventoryInstaller.cs"
click node_system_installer "https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Scripts/Installer/SystemInstaller.cs"
click node_inventory_domain "https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Submodules/InventorySDK/Domain/InventoryDomain.cs"
click node_item_info "https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Submodules/InventorySDK/Domain/ItemInfo.cs"
click node_inventory_application "https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Submodules/InventorySDK/Application/InventoryApplication.cs"
click node_csv_repository "https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Submodules/InventorySDK/Infrastructure/CsvItemRepository.cs"
click node_json_repository "https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Submodules/InventorySDK/Infrastructure/JsonItemRepository.cs"
click node_item_csv "https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/StreamingAssets/items.csv"
click node_equipment_domain "https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Submodules/EquipmentSDK/Domain/EquipmentDomain.cs"
click node_equipment_application "https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Submodules/EquipmentSDK/Application/EquipmentApplication.cs"
click node_equip_part "https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Submodules/InventorySDK/Domain/EquipPart.cs"
click node_inventory_model "https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Scripts/Model/InventoryModel.cs"
click node_equipment_model "https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Scripts/Model/EquipmentModel.cs"
click node_catalog_model "https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Scripts/Model/ItemCatalogModel.cs"
click node_inventory_presenter "https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Scripts/Presenter/InventoryPresenter.cs"
click node_equipment_presenter "https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Scripts/Presenter/EquipmentPresenter.cs"
click node_inventory_view "https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Scripts/View/InventoryView.cs"
click node_inventory_view_contract "https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Scripts/Presenter/IInventoryView.cs"
click node_equipment_view_contract "https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Scripts/Presenter/IEquipmentView.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_scenes,node_item_icons toneBlue
class node_zenject,node_inventory_installer,node_system_installer toneAmber
class node_inventory_domain,node_item_info,node_inventory_application,node_csv_repository,node_json_repository,node_item_csv toneMint
class node_equipment_domain,node_equipment_application,node_equip_part toneRose
class node_inventory_model,node_equipment_model,node_catalog_model,node_inventory_presenter,node_equipment_presenter,node_inventory_view,node_inventory_view_contract,node_equipment_view_contract toneIndigo
```

## Components

### Unity Runtime

- [Playable Scenes](https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/Scenes/SampleScene.unity): Unity scenes · Scene-driven composition entry points. · `Assets/Scenes/SampleScene.unity`
- **Item Icons**: Unity Resources

### Composition

- [Zenject Container](https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/Plugins/Zenject/Source/Main/DiContainer.cs): DI runtime · `Assets/Plugins/Zenject/Source/Main/DiContainer.cs`
- [Inventory Installer](https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Scripts/Installer/InventoryInstaller.cs): DI installer · `Assets/01.OnionArc/Scripts/Installer/InventoryInstaller.cs`
- [System Installer](https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Scripts/Installer/SystemInstaller.cs): DI installer · `Assets/01.OnionArc/Scripts/Installer/SystemInstaller.cs`

### Inventory Onion SDK

- [Inventory Domain](https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Submodules/InventorySDK/Domain/InventoryDomain.cs): domain contracts · Defines inventory rules and placement concepts. · `Assets/01.OnionArc/Submodules/InventorySDK/Domain/InventoryDomain.cs`
- [Item Metadata](https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Submodules/InventorySDK/Domain/ItemInfo.cs): domain type · `Assets/01.OnionArc/Submodules/InventorySDK/Domain/ItemInfo.cs`
- [Inventory Application](https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Submodules/InventorySDK/Application/InventoryApplication.cs): application service · `Assets/01.OnionArc/Submodules/InventorySDK/Application/InventoryApplication.cs`
- [CSV Item Repository](https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Submodules/InventorySDK/Infrastructure/CsvItemRepository.cs): repository adapter · `Assets/01.OnionArc/Submodules/InventorySDK/Infrastructure/CsvItemRepository.cs`
- [JSON Item Repository](https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Submodules/InventorySDK/Infrastructure/JsonItemRepository.cs): repository adapter · `Assets/01.OnionArc/Submodules/InventorySDK/Infrastructure/JsonItemRepository.cs`
- [Item Catalog CSV](https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/StreamingAssets/items.csv): packaged data · `Assets/StreamingAssets/items.csv`

### Equipment Onion SDK

- [Equipment Domain](https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Submodules/EquipmentSDK/Domain/EquipmentDomain.cs): domain contracts · `Assets/01.OnionArc/Submodules/EquipmentSDK/Domain/EquipmentDomain.cs`
- [Equipment Application](https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Submodules/EquipmentSDK/Application/EquipmentApplication.cs): application service · `Assets/01.OnionArc/Submodules/EquipmentSDK/Application/EquipmentApplication.cs`
- [Equipment Parts](https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Submodules/InventorySDK/Domain/EquipPart.cs): shared domain type · `Assets/01.OnionArc/Submodules/InventorySDK/Domain/EquipPart.cs`

### MVP Runtime

- [Inventory Model](https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Scripts/Model/InventoryModel.cs): Unity state model · `Assets/01.OnionArc/Scripts/Model/InventoryModel.cs`
- [Equipment Model](https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Scripts/Model/EquipmentModel.cs): Unity state model · `Assets/01.OnionArc/Scripts/Model/EquipmentModel.cs`
- [Item Catalog Model](https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Scripts/Model/ItemCatalogModel.cs): Unity state model · `Assets/01.OnionArc/Scripts/Model/ItemCatalogModel.cs`
- [Inventory Presenter](https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Scripts/Presenter/InventoryPresenter.cs): MVP presenter · `Assets/01.OnionArc/Scripts/Presenter/InventoryPresenter.cs`
- [Equipment Presenter](https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Scripts/Presenter/EquipmentPresenter.cs): MVP presenter · `Assets/01.OnionArc/Scripts/Presenter/EquipmentPresenter.cs`
- [Inventory View](https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Scripts/View/InventoryView.cs): Unity UI view · `Assets/01.OnionArc/Scripts/View/InventoryView.cs`
- [Inventory View Contract](https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Scripts/Presenter/IInventoryView.cs): MVP interface · `Assets/01.OnionArc/Scripts/Presenter/IInventoryView.cs`
- [Equipment View Contract](https://github.com/0s-been/hello_world_c_cpp_adventure/blob/main/Assets/01.OnionArc/Scripts/Presenter/IEquipmentView.cs): MVP interface · `Assets/01.OnionArc/Scripts/Presenter/IEquipmentView.cs`

## Connections

- Playable Scenes → Inventory Installer: hosts
- Playable Scenes → System Installer: hosts
- Inventory Installer → Zenject Container: registers bindings with
- System Installer → Zenject Container: registers bindings with
- Inventory Installer → Inventory Presenter: wires
- Inventory Installer → Inventory Model: wires
- System Installer → Equipment Presenter: wires
- System Installer → Equipment Model: wires
- Inventory View → Inventory Presenter: user actions
- Inventory Presenter → Inventory View Contract: updates through
- Inventory Presenter → Inventory Model: mutates
- Equipment Presenter → Equipment View Contract: updates through
- Equipment Presenter → Equipment Model: mutates
- Inventory Model → Inventory Application: uses
- Equipment Model → Equipment Application: uses
- Item Catalog Model → CSV Item Repository: loads catalog through
- Item Catalog Model → Item Icons: loads sprites from
- Inventory Application → Inventory Domain: orchestrates
- Inventory Domain → Item Metadata: uses
- CSV Item Repository → Item Catalog CSV: reads
- JSON Item Repository → Item Metadata: maps
- CSV Item Repository → Item Metadata: maps
- Equipment Application → Equipment Domain: orchestrates
- Equipment Domain → Equipment Parts: uses
- Equipment Domain → Inventory Domain: consumes inventory concepts
