pub struct CraftOutcome {
pub recipe_id: String,
pub items_produced: Vec<(String, u32, u8)>,
pub experience_gained: u32,
pub legendary_proc: bool,
pub actual_duration: f32,
}Expand description
A resolved crafting outcome with final computed values.
Fields§
§recipe_id: String§items_produced: Vec<(String, u32, u8)>Produced items: (item_id, quantity, quality_byte).
experience_gained: u32XP awarded.
legendary_proc: boolWhether any Legendary quality item was produced.
actual_duration: f32Duration the craft actually took (seconds).
Implementations§
Source§impl CraftOutcome
impl CraftOutcome
pub fn new(recipe_id: impl Into<String>) -> Self
pub fn with_item( self, item_id: impl Into<String>, quantity: u32, quality: u8, ) -> Self
pub fn with_xp(self, xp: u32) -> Self
pub fn with_duration(self, secs: f32) -> Self
Sourcepub fn total_items(&self) -> u32
pub fn total_items(&self) -> u32
Total items produced across all result slots.
Sourcepub fn best_quality_tier(&self) -> Option<QualityTier>
pub fn best_quality_tier(&self) -> Option<QualityTier>
Best quality tier produced.
Trait Implementations§
Source§impl Clone for CraftOutcome
impl Clone for CraftOutcome
Source§fn clone(&self) -> CraftOutcome
fn clone(&self) -> CraftOutcome
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 CraftOutcome
impl RefUnwindSafe for CraftOutcome
impl Send for CraftOutcome
impl Sync for CraftOutcome
impl Unpin for CraftOutcome
impl UnsafeUnpin for CraftOutcome
impl UnwindSafe for CraftOutcome
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.