Skip to main content

openstranded_common_items/
lib.rs

1//! # openstranded-common-items
2//!
3//! Shared data types for the OpenStranded item system.
4//!
5//! This crate defines the canonical structures that represent item types
6//! and item stacks, used by both the engine (Bevy ECS components) and WASM
7//! game plugins (parsing `.ron` registry data, defining service contracts).
8//!
9//! ## Types
10//!
11//! | Type | Purpose |
12//! |------|---------|
13//! | [`ItemDef`] | Full item type definition |
14//! | [`ItemGroup`] | Category enum (material, food, tool, weapon, …) |
15//! | [`Material`] | Material enum (wood, stone, metal, flesh, …) |
16//! | [`ItemStack`] | ECS component: `item_id` + `amount` + optional `durability` |
17//!
18//! ## Dependency
19//!
20//! Only `serde` — this is a pure data crate with no engine or plugin API
21//! dependencies.
22
23mod item_def;
24mod item_stack;
25
26pub use item_def::{ItemDef, ItemGroup, Material};
27pub use item_stack::ItemStack;