pub struct LootPool {
pub rolls: NumberProvider,
pub bonus_rolls: f32,
pub entries: &'static [LootEntry],
pub conditions: &'static [LootCondition],
pub functions: &'static [ConditionalLootFunction],
}Expand description
A pool of loot entries with roll counts.
Fields§
§rolls: NumberProvider§bonus_rolls: f32§entries: &'static [LootEntry]§conditions: &'static [LootCondition]§functions: &'static [ConditionalLootFunction]Implementations§
Source§impl LootPool
impl LootPool
Sourcefn add_random_items<R: Rng>(
&self,
ctx: &mut LootContext<'_, R>,
result: &mut Vec<ItemStack>,
)
fn add_random_items<R: Rng>( &self, ctx: &mut LootContext<'_, R>, result: &mut Vec<ItemStack>, )
Add random items from this pool to the result.
Sourcefn add_random_item<R: Rng>(
&self,
ctx: &mut LootContext<'_, R>,
result: &mut Vec<ItemStack>,
)
fn add_random_item<R: Rng>( &self, ctx: &mut LootContext<'_, R>, result: &mut Vec<ItemStack>, )
Select and add a single random item from this pool.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LootPool
impl RefUnwindSafe for LootPool
impl Send for LootPool
impl Sync for LootPool
impl Unpin for LootPool
impl UnsafeUnpin for LootPool
impl UnwindSafe for LootPool
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<>>