pub struct SpawnEntry {
pub id: String,
pub name: String,
pub weight: f32,
pub tier: SpawnTier,
pub min_depth: u32,
pub max_depth: u32,
pub tags: Vec<String>,
pub group: (u32, u32),
pub stats: (f32, f32, f32),
}Expand description
One entry in a spawn table.
Fields§
§id: StringUnique identifier (e.g., “skeleton_archer”).
name: StringDisplay name.
weight: f32Selection weight (positive).
tier: SpawnTierRarity tier.
min_depth: u32Minimum dungeon depth to appear.
max_depth: u32Maximum dungeon depth (u32::MAX = no limit).
Category tags (e.g., “undead”, “melee”, “ranged”).
group: (u32, u32)Group count: how many of this type spawn at once (min, max).
stats: (f32, f32, f32)Scaled properties: (base_hp, base_damage, base_xp).
Implementations§
Source§impl SpawnEntry
impl SpawnEntry
pub fn new( id: impl Into<String>, name: impl Into<String>, tier: SpawnTier, ) -> Self
pub fn with_depth(self, min: u32, max: u32) -> Self
pub fn with_weight(self, w: f32) -> Self
pub fn with_group(self, min: u32, max: u32) -> Self
pub fn with_stats(self, hp: f32, dmg: f32, xp: f32) -> Self
Sourcepub fn valid_for_depth(&self, depth: u32) -> bool
pub fn valid_for_depth(&self, depth: u32) -> bool
Is this entry valid for the given depth?
Trait Implementations§
Source§impl Clone for SpawnEntry
impl Clone for SpawnEntry
Source§fn clone(&self) -> SpawnEntry
fn clone(&self) -> SpawnEntry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SpawnEntry
impl RefUnwindSafe for SpawnEntry
impl Send for SpawnEntry
impl Sync for SpawnEntry
impl Unpin for SpawnEntry
impl UnsafeUnpin for SpawnEntry
impl UnwindSafe for SpawnEntry
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.