pub struct RecipeDefinition {Show 16 fields
pub id: u64,
pub name: String,
pub description: String,
pub ingredients: Vec<CraftingIngredient>,
pub output_item_id: u64,
pub output_count: u32,
pub required_station: CraftingStation,
pub skill_requirements: Vec<SkillRequirement>,
pub base_success_chance: f32,
pub skill_bonus_per_level: f32,
pub quality_outcomes: Vec<QualityOutcome>,
pub byproducts: Vec<(u64, u32, f32)>,
pub crafting_time_seconds: f32,
pub unlocked_by_default: bool,
pub unlock_source: Option<String>,
pub experience_reward: HashMap<String, u32>,
}Fields§
§id: u64§name: String§description: String§ingredients: Vec<CraftingIngredient>§output_item_id: u64§output_count: u32§required_station: CraftingStation§skill_requirements: Vec<SkillRequirement>§base_success_chance: f32§skill_bonus_per_level: f32§quality_outcomes: Vec<QualityOutcome>§byproducts: Vec<(u64, u32, f32)>§crafting_time_seconds: f32§unlocked_by_default: bool§unlock_source: Option<String>§experience_reward: HashMap<String, u32>Implementations§
Source§impl RecipeDefinition
impl RecipeDefinition
pub fn success_probability(&self, skill_level: u32) -> f32
pub fn expected_quality(&self, skill_level: u32) -> f32
pub fn crafting_time_with_speed(&self, crafting_speed_multiplier: f32) -> f32
pub fn sample_quality(&self, roll: f32) -> f32
pub fn validate_ingredients(&self, available: &HashMap<u64, u32>) -> bool
Trait Implementations§
Source§impl Clone for RecipeDefinition
impl Clone for RecipeDefinition
Auto Trait Implementations§
impl Freeze for RecipeDefinition
impl RefUnwindSafe for RecipeDefinition
impl Send for RecipeDefinition
impl Sync for RecipeDefinition
impl Unpin for RecipeDefinition
impl UnsafeUnpin for RecipeDefinition
impl UnwindSafe for RecipeDefinition
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.