openstranded_common_crafting/lib.rs
1//! # openstranded-common-crafting
2//!
3//! Shared data types for the OpenStranded crafting system.
4//!
5//! This crate defines the canonical structures that represent crafting
6//! recipes, their requirements, and their results. Used by both the
7//! engine (Bevy ECS resources) and WASM game plugins (parsing `.ron`
8//! registry data, defining service contracts).
9//!
10//! ## Types
11//!
12//! | Type | Purpose |
13//! |------|---------|
14//! | [`RecipeDef`] | A single crafting recipe (combi block) |
15//! | [`RecipeRequirement`] | An ingredient with optional stay flag |
16//! | [`RecipeResult`] | A generated item |
17//!
18//! ## Relationship to `.inf` files
19//!
20//! In the original game, each `combi=start`…`combi=end` block inside a
21//! `combinations*.inf` file corresponds to one [`RecipeDef`]. Each
22//! `req=N[,count[,stay]]` line inside becomes a [`RecipeRequirement`],
23//! and each `gen=N[,count]` line becomes a [`RecipeResult`].
24//!
25//! ## Dependency
26//!
27//! Only `serde` — this is a pure data crate with no engine or plugin API
28//! dependencies.
29
30mod recipe_def;
31
32pub use recipe_def::{RecipeDef, RecipeRequirement, RecipeResult};