pub struct ZoneStats {
pub heat: f32,
pub density: f32,
pub cooldown: u32,
pub changed_count: usize,
pub last_injection_generation: u64,
}Expand description
Statistics for a single zone in the life field.
Fields§
§heat: f32Heat value representing recent activity (decays over time).
density: f32Current cell density in this zone (0.0-1.0).
cooldown: u32Cooldown counter preventing immediate re-injection.
changed_count: usizeCount of cells that changed this generation.
last_injection_generation: u64Generation when this zone was last injected (0 = never).
Implementations§
Source§impl ZoneStats
impl ZoneStats
Sourcepub fn record_change(&mut self)
pub fn record_change(&mut self)
Records a cell change in this zone.
Sourcepub fn decay_heat(&mut self, decay: f32)
pub fn decay_heat(&mut self, decay: f32)
Decays the heat value by the given factor.
Sourcepub fn update_density(&mut self, alive: usize, total: usize)
pub fn update_density(&mut self, alive: usize, total: usize)
Updates the density value.
Sourcepub fn tick_cooldown(&mut self)
pub fn tick_cooldown(&mut self)
Decrements cooldown if active.
Sourcepub fn set_cooldown(&mut self, min: u32, max: u32, rng: &mut impl Rng)
pub fn set_cooldown(&mut self, min: u32, max: u32, rng: &mut impl Rng)
Sets cooldown to a random value between min and max.
Sourcepub fn reset_changed(&mut self)
pub fn reset_changed(&mut self)
Resets the changed count for a new generation.
Sourcepub fn is_on_cooldown(&self) -> bool
pub fn is_on_cooldown(&self) -> bool
Check if zone is on cooldown
Sourcepub fn is_cold_empty(&self) -> bool
pub fn is_cold_empty(&self) -> bool
Check if zone is cold (low heat) and empty (very low density)
Sourcepub fn is_cold_ash(&self) -> bool
pub fn is_cold_ash(&self) -> bool
Check if zone is cold (low heat) and has ash/debris (moderate density)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ZoneStats
impl RefUnwindSafe for ZoneStats
impl Send for ZoneStats
impl Sync for ZoneStats
impl Unpin for ZoneStats
impl UnsafeUnpin for ZoneStats
impl UnwindSafe for ZoneStats
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more