How 0s-been/hello_world_c_cpp_adventure works
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: InventoryInstaller.cs Inventory Installer · SystemInstaller.cs System Installer · InventoryPresenter.cs Inventory Presenter · CsvItemRepository.cs CSV Item Repository
Components 22
Unity Runtime
- Playable Scenes · Scene-driven composition entry points.
Assets/Scenes/SampleScene.unity - Item Icons
Composition
- Zenject Container
Assets/Plugins/Zenject/Source/Main/DiContainer.cs - Inventory Installer
Assets/01.OnionArc/Scripts/Installer/InventoryInstaller.cs - System Installer
Assets/01.OnionArc/Scripts/Installer/SystemInstaller.cs
Inventory Onion SDK
- Inventory Domain · Defines inventory rules and placement concepts.
Assets/01.OnionArc/Submodules/InventorySDK/Domain/InventoryDomain.cs - Item Metadata
Assets/01.OnionArc/Submodules/InventorySDK/Domain/ItemInfo.cs - Inventory Application
Assets/01.OnionArc/Submodules/InventorySDK/Application/InventoryApplication.cs - CSV Item Repository
Assets/01.OnionArc/Submodules/InventorySDK/Infrastructure/CsvItemRepository.cs - JSON Item Repository
Assets/01.OnionArc/Submodules/InventorySDK/Infrastructure/JsonItemRepository.cs - Item Catalog CSV
Assets/StreamingAssets/items.csv
Equipment Onion SDK
- Equipment Domain
Assets/01.OnionArc/Submodules/EquipmentSDK/Domain/EquipmentDomain.cs - Equipment Application
Assets/01.OnionArc/Submodules/EquipmentSDK/Application/EquipmentApplication.cs - Equipment Parts
Assets/01.OnionArc/Submodules/InventorySDK/Domain/EquipPart.cs
MVP Runtime
- Inventory Model
Assets/01.OnionArc/Scripts/Model/InventoryModel.cs - Equipment Model
Assets/01.OnionArc/Scripts/Model/EquipmentModel.cs - Item Catalog Model
Assets/01.OnionArc/Scripts/Model/ItemCatalogModel.cs - Inventory Presenter
Assets/01.OnionArc/Scripts/Presenter/InventoryPresenter.cs - Equipment Presenter
Assets/01.OnionArc/Scripts/Presenter/EquipmentPresenter.cs - Inventory View
Assets/01.OnionArc/Scripts/View/InventoryView.cs - Inventory View Contract
Assets/01.OnionArc/Scripts/Presenter/IInventoryView.cs - Equipment View Contract
Assets/01.OnionArc/Scripts/Presenter/IEquipmentView.cs
Connections 25
- 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