Skip to main content

Module items

Module items 

Source
Expand description

§Items module

Core traits and types for item management in a JRPG engine.

Provides ItemProvider for querying item metadata and applying effects, and ShopProvider for shop inventories. Both traits use associated types so that implementing crates supply their own concrete item, effect, monster, and shop-identifier types — no game-specific data lives in this module.

§Supporting types

TypePurpose
Inventory<I>Generic item inventory with add / remove / contains
ItemResultOutcome of attempting to use an item
BagCategoryBroad classification of item types for UI organisation

Re-exports§

pub use use_driver::buy;
pub use use_driver::sell;
pub use use_driver::use_item;
pub use use_driver::ItemUseResult;
pub use use_driver::ShopError;
pub use use_driver::ShopReceipt;
pub use use_driver::UsageContext;
pub use kind::ItemKind;
pub use equip::EquipProvider;
pub use equip::EquipSlot;

Modules§

equip
Equipment system
kind
Item kind classification
use_driver
Generic item-effect application + bag/shop buy-sell flow (P0e).

Structs§

Inventory
Generic item inventory that stores (item, quantity) pairs.

Enums§

AddError
Error returned when adding an item to an inventory fails due to capacity limits.
BagCategory
Broad classification of item types, used by UI code to organise bag menus.
ItemResult
Outcome of attempting to apply an item to a monster.

Traits§

ItemProvider
Provider trait for item metadata, usage rules, and effects.
ShopProvider
Provider trait for shop / mart data.

Type Aliases§

SimpleInventory
Convenience alias for a large-capacity inventory.