pub struct LootDrop {
pub id: String,
pub name: String,
pub tier: LootTier,
pub quantity: (u32, u32),
pub weight: f32,
pub depth_min: u32,
pub depth_max: u32,
}Expand description
One possible drop from a loot table.
Fields§
§id: String§name: String§tier: LootTier§quantity: (u32, u32)§weight: f32§depth_min: u32§depth_max: u32Implementations§
Source§impl LootDrop
impl LootDrop
pub fn new( id: impl Into<String>, name: impl Into<String>, tier: LootTier, ) -> Self
pub fn with_quantity(self, min: u32, max: u32) -> Self
pub fn with_depth(self, min: u32, max: u32) -> Self
pub fn with_weight(self, w: f32) -> Self
pub fn is_valid_at(&self, depth: u32) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LootDrop
impl RefUnwindSafe for LootDrop
impl Send for LootDrop
impl Sync for LootDrop
impl Unpin for LootDrop
impl UnsafeUnpin for LootDrop
impl UnwindSafe for LootDrop
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.