diff --git a/crates/config/src/monsters.rs b/crates/config/src/monsters.rs index 4f538fc..9adb449 100644 --- a/crates/config/src/monsters.rs +++ b/crates/config/src/monsters.rs @@ -2,6 +2,7 @@ // File: config/src/monsters.rs //! The inner config for monster module //! +#![allow(dead_code)] use clap::{Args, ValueEnum}; diff --git a/crates/monsters/src/lib.rs b/crates/monsters/src/lib.rs index b49078d..c9851f4 100644 --- a/crates/monsters/src/lib.rs +++ b/crates/monsters/src/lib.rs @@ -13,6 +13,8 @@ //! (`MonsterConfig`) and delegates to the appropriate sub‑routine (clean, export or show). //! +pub mod monster_structs; + use anyhow::Result; use cli_parser::Config; use config::monsters::MonsterConfig; diff --git a/crates/monsters/src/monster_structs.rs b/crates/monsters/src/monster_structs.rs new file mode 100644 index 0000000..e1ca465 --- /dev/null +++ b/crates/monsters/src/monster_structs.rs @@ -0,0 +1,60 @@ +//! # Monster Structures +//! +//! The `monster_structs` crate defines the data model that represents a monster +//! as it is loaded from the database. All structs are intentionally kept +//! +//! ## Overview +//! ```text +//! FullMonster → MonsterStats +//! ↘ MonsterAttacks → Vec +//! ↗ MonsterResistances → Vec +//! ``` +//! +#![allow(dead_code)] + +/// A monster ready for consumption by other modules. +pub struct FullMonster { + /// Unique identifier, derived when the monster is instantiated. + pub id: usize, + + /// Monster’s name. + pub name: String, + + /// Serialized stats directly copied from the database table. + pub stats: MonsterStats, + + /// Collection of attacks, wrapped in a helper that exposes useful functions. + pub attacks: MonsterAttacks, + + /// Collection of resistances, wrapped in a helper for convenient iteration. + pub resistances: MonsterResistances, +} + +/// Raw stat values deserialized straight from the database. +pub struct MonsterStats {} + +/// A helper wrapper around all attacks belonging to a monster. +/// +/// The inner vector holds individual attack rows (`MonsterSingleAttack`); +/// helper methods on this struct (not shown here) can split or aggregate +/// these rows into more ergonomic data structures. +pub struct MonsterAttacks { + /// All attack rows for the monster, as read from the database. + pub attacks: Vec, +} + +/// A helper wrapper around all resistances belonging to a monster. +/// +/// The inner vector contains `MonsterSingleResistance` entries; methods +/// on this struct can provide iterators or lookup functions that are +/// easier to consume than raw rows. +pub struct MonsterResistances { + /// All resistance rows for the monster, as read from the database. + pub resistances: Vec, +} + +/// Represents a single row of resistance data for a monster. +pub struct MonsterSingleResistance {} + +/// Represents a single attack entry as deserialized from the database. +pub struct MonsterSingleAttack {}