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