Operation Flow
Context
FInventoryOpContext holds OperationID, OperationTag, OpState, weak Pawn/component references, source/target inventory tags and slot GUIDs, ItemID, RequestedAmount, AppliedAmount and FailReason. Default OpState is None and RequestedAmount is zero; callers constructing contexts must initialize them for a supported path.
Subsystem wrapper → Requested → Validating → Executing
├→ Completed
└→ Failed
RunOperation repeatedly calls ProcessOperationState until Completed, Failed or RolledBack. A safety counter reports failure after exceeding its maximum transition count. Predicting, Replicating and Reconciling are enum values without active processing in the reviewed dispatcher; RolledBack is only handled as a terminal value. No asynchronous operation completion delegate is provided.
Validation and Dispatch
Validating checks RequestingPawn, a positive RequestedAmount, operation-specific ItemID or SourceSlotID, and resolves inventories for populated tags. Execution then delegates to add/remove/slot/transfer methods. Unsupported registered tags produce Unhandled operation tag.
| Tag suffix under Cube_Inventory.Op | Execution branch |
|---|---|
| Add.ToInventory | AddAmountToSpecificInventory |
| Add.ToSlot | AddToSlot |
| Remove.FromInventory | RemoveAmount, using database default route |
| Remove.FromSlot | RemoveFromSlot |
| Split | Component SplitSlot |
| Merge | Manager MergeSlots |
| Swap | Manager TransferOwnSlot |
| Transfer.External | Manager TransferExternalSlot |
Move, Clear, Sort, Resize, Consume, Generate and Transfer.Internal are registered tag names, not implemented execution branches. Split/Merge have no convenience wrapper on the subsystem; manager RunOperation is native UFUNCTION without BlueprintCallable.
Results
Subsystem wrappers return a pointer/bool and output parameters after the local operation completes. Add APIs expose an actual added quantity. AppliedAmount is not a reliable universal delta: external transfer reports the requested amount although the helper clamps to availability; merge/swap do not set it. Completed does not mean every unit requested was added, nor that all planned transaction invariants were verified. See Failure Modes.