Skip to main content

LootModifier

Trait LootModifier 

Source
pub trait LootModifier: Debug {
    // Required methods
    fn modify_weight(
        &self,
        item_id: u32,
        base_weight: f32,
        context: &LootContext,
    ) -> f32;
    fn modifier_name(&self) -> &str;
}

Required Methods§

Source

fn modify_weight( &self, item_id: u32, base_weight: f32, context: &LootContext, ) -> f32

Source

fn modifier_name(&self) -> &str

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§