Skip to content

📦 Crafting — Inventory Adapters

This folder contains Crafting adapters that integrate with the RevFramework Inventory system.

Adapters here implement: - ICraftingInventoryAdapter - optionally ICraftingInventoryReservationAdapter

They translate Crafting inventory requests into calls to the scene inventory service and item database.


✅ Inventory crafting adapter

InventoryCraftingAdapter

  • Compiled when REV_INVENTORY_PRESENT is defined.
  • Forwards inventory operations to SceneInventoryService.
  • Uses an adapter-owned, opaque container handle.
  • Crafting code never accesses inventory internals directly.

Supported operations: - container resolution - item counting - space checks (non-reserving) - exact add / consume mutations

All operations are defensive: - missing services - invalid handles - invalid identifiers

Result in safe failure (false / 0), not exceptions.


🛡️ Reservation / escrow support

Although this adapter implements ICraftingInventoryReservationAdapter, the current Inventory system does not expose reservation primitives.

As a result: - input reservations always fail safely - output reservations always fail safely - no atomic or escrow crafting is provided

This is an explicit opt-out that allows Crafting to detect unsupported strong crafting flows without undefined behaviour.


🧠 Event deferral

DeferEvents always returns a non-null disposable.

This adapter does not batch or defer inventory events. The returned scope is a no-op.