Skip to main content

openstranded_common_objects/
lib.rs

1//! # openstranded-common-objects
2//!
3//! Shared data types for the OpenStranded world object system.
4//!
5//! This crate defines the canonical structures that represent world
6//! objects — static and interactive entities like trees, rocks,
7//! buildings, grass, flowers, and stuff.
8//!
9//! ## Types
10//!
11//! | Type | Purpose |
12//! |------|---------|
13//! | [`ObjectDef`] | Full definition of one object type |
14//! | [`CollisionMode`] | Collision mode enum |
15//! | [`ObjectScale`] | Per-axis scale factors |
16//! | [`ObjectState`] | State offset mode (random / fixed) |
17//! | [`SpawnDef`] | Periodic item-spawn configuration |
18//! | [`HarvestDef`] | Item-find / search configuration |
19//!
20//! ## Relationship to `.inf` files
21//!
22//! Each `id=N` entry in an `objects*.inf` file corresponds to one
23//! [`ObjectDef`].  All fields are mapped from their `.inf` names to
24//! Rust struct fields by [`ObjectDef::from_inf_fields`].
25//!
26//! ## Dependency
27//!
28//! Only `serde` — this is a pure data crate with no engine or plugin API
29//! dependencies.
30
31mod object_def;
32
33pub use object_def::{
34    CollisionMode, HarvestDef, ObjectDef, ObjectScale, ObjectState, SpawnDef,
35};