pub struct Growth {
pub maximum: f32,
pub timer: i64,
pub smoothed: f32,
pub scheduled: bool,
pub smoothing: bool,
pub allow_negative: bool,
}Expand description
The growth state of a natural resource (a tree, a crop, a herb).
Fields§
§maximum: f32The growth at which the resource is fully grown (a random value).
timer: i64System::Time, not an accumulated f32.
smoothed: f32Visible value, separate from NaturalResourceComponent.
scheduled: boolWhether the scheduled update still runs (false once fully grown).
smoothing: boolWhether the visible value still moves towards the growth.
allow_negative: boolNaturalResourceComponent capability bit 0x100000; false on newly seeded resources.
Implementations§
Source§impl Growth
impl Growth
Sourcepub fn initialise(
d: &GrowthDescription,
maximum: f32,
fraction: f32,
rng: &mut Random,
) -> (Self, f32, [f32; 4])
pub fn initialise( d: &GrowthDescription, maximum: f32, fraction: f32, rng: &mut Random, ) -> (Self, f32, [f32; 4])
Set the growth, the visible scale and the random timer, without another random draw for the maximum (seeding has drawn it already).
Original: FUN_140126280.
Trait Implementations§
impl StructuralPartialEq for Growth
Auto Trait Implementations§
impl Freeze for Growth
impl RefUnwindSafe for Growth
impl Send for Growth
impl Sync for Growth
impl Unpin for Growth
impl UnsafeUnpin for Growth
impl UnwindSafe for Growth
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