Module inventory

Source
Expand description

Fixed-capacity inventories with one bounded stack per item and atomic edits.

Inventory::exchange trades existing items between two inventories, while Inventory::transfer_to moves them in one direction. Their check_ methods perform the same preflight without changing either inventory. Recipe costs and newly created outputs remain the responsibility of super::crafting::craft.

Structs§

Inventory
Stack

Enums§

ExchangeError
First rejected part of an exchange. Neither inventory changes on an error.
ExchangeSide
Inventory to which an ExchangeError applies, relative to the method call.

Constants§

MAX_EXCHANGE_ITEMS
Maximum number of outgoing entries per side of an exchange, including repeats.