pub struct AgeableMobGroupData {
group_size: i32,
should_spawn_baby: bool,
baby_spawn_chance: f32,
}Fields§
§group_size: i32§should_spawn_baby: bool§baby_spawn_chance: f32Implementations§
Source§impl AgeableMobGroupData
impl AgeableMobGroupData
pub const DEFAULT_BABY_SPAWN_CHANCE: f32 = 0.05
pub const fn new(should_spawn_baby: bool, baby_spawn_chance: f32) -> Self
pub const fn with_should_spawn_baby(should_spawn_baby: bool) -> Self
pub const fn with_baby_spawn_chance(baby_spawn_chance: f32) -> Self
pub const fn group_size(self) -> i32
pub const fn should_spawn_baby(self) -> bool
pub const fn baby_spawn_chance(self) -> f32
pub const fn increase_group_size_by_one(&mut self)
pub const fn needs_baby_spawn_roll(self) -> bool
pub fn finalize_ageable_spawn( &mut self, baby_roll: impl FnOnce() -> f32, ) -> bool
Trait Implementations§
Source§impl Clone for AgeableMobGroupData
impl Clone for AgeableMobGroupData
Source§fn clone(&self) -> AgeableMobGroupData
fn clone(&self) -> AgeableMobGroupData
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for AgeableMobGroupData
Source§impl Debug for AgeableMobGroupData
impl Debug for AgeableMobGroupData
Source§impl PartialEq for AgeableMobGroupData
impl PartialEq for AgeableMobGroupData
impl StructuralPartialEq for AgeableMobGroupData
Auto Trait Implementations§
impl Freeze for AgeableMobGroupData
impl RefUnwindSafe for AgeableMobGroupData
impl Send for AgeableMobGroupData
impl Sync for AgeableMobGroupData
impl Unpin for AgeableMobGroupData
impl UnsafeUnpin for AgeableMobGroupData
impl UnwindSafe for AgeableMobGroupData
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 moreWraps this value in an
Arc<SyncMutex<>>