···11# Immediate Stats
2233Game stats that reset every frame. Inspired by immediate mode rendering.
44-55-== Todo Info about derive macro.
44+Includes a derive macro which propagates stat resets to any stat fields.
6576```rust
87#[derive(StatContainer)]
+1-1
immediate_stats/Cargo.toml
···22name = "immediate_stats"
33version = "0.1.0"
44edition = "2024"
55-description = "A crate for making immediate-mode stats."
55+description = "Game stats that reset every frame. Inspired by immediate mode rendering."
66categories = ["game-development", "data-structures"]
77keywords = ["game", "gamedev", "bevy", "stats", "proc-macro"]
88repository = "https://github.com/AlephCubed/immediate_stats"
+1-2
immediate_stats/README.md
···11# Immediate Stats
2233Game stats that reset every frame. Inspired by immediate mode rendering.
44-55-== Todo Info about derive macro.
44+Includes a derive macro which propagates stat resets to any stat fields.
6576```rust
87#[derive(StatContainer)]
+7-6
immediate_stats/src/lib.rs
···11//! Game stats that reset every frame.
22//! Inspired by immediate mode rendering.
33//!
44-//! == Todo Info about derive macro.
44+//! Includes a [derive macro](macro@StatContainer) which propagates stat resets to any stat fields.
55+//!
56//! ```rust no_run
67//! # use immediate_stats::*;
78//! #[derive(StatContainer)]
···1617//! // The order does not matter. Bonuses are always applied before multipliers.
1718//! assert_eq!(speed.0.total(), 30); // (10 + 5) * 2 = 30
1819//!
1919-//! speed.reset_modifiers(); // Reset bonus and multiplier, so speed is back to 10.
2020+//! speed.reset_modifiers(); // Reset speed back to 10.
2021//! }
2122//! }
2223//! ```
···2526//!
2627//! There is build-in integration with the [Bevy Engine](https://bevyengine.org)
2728//! via the `bevy` feature flag.
2828-//! This adds systems for resetting `StatContainer` components and resources.
2929+//! This adds systems for resetting [`StatContainer`] components and resources.
2930//!
3031#![cfg_attr(not(feature = "bevy"), doc = "```rust ignore")]
3132#![cfg_attr(feature = "bevy", doc = "```rust")]
···7778pub mod stat;
78797980/// Implements [`reset_modifiers`](StatContainer::reset_modifiers)
8080-/// by passing on the call to any sub-stats.
8181+/// by propagating the call down to any `StatContainer` fields.
8182/// ```rust
8283/// # use immediate_stats::*;
8384/// #[derive(StatContainer, Default, Debug, PartialEq)]
···110111/// #[derive(StatContainer)]
111112/// struct PartialReset {
112113/// #[stat]
113113-/// custom: Health,
114114+/// custom: Health, // Will get reset.
114115/// #[stat_ignore]
115115-/// ignored: Stat,
116116+/// ignored: Stat, // Will not get reset.
116117/// }
117118///
118119/// fn main () {
+1-1
immediate_stats_macros/Cargo.toml
···22name = "immediate_stats_macros"
33version = "0.1.0"
44edition = "2024"
55-description = "A crate for making immediate-mode stats."
55+description = "Game stats that reset every frame. Inspired by immediate mode rendering."
66categories = ["game-development", "data-structures"]
77keywords = ["game", "gamedev", "bevy", "stats", "proc-macro"]
88repository = "https://github.com/AlephCubed/immediate_stats"