pub struct Recipe {
pub id: u64,
pub name: String,
pub ingredients: Vec<RecipeIngredient>,
pub result_item_id: u64,
pub result_count: u32,
pub required_level: u32,
pub success_chance: f32,
pub station: CraftingStation,
pub xp_reward: u64,
}Fields§
§id: u64§name: String§ingredients: Vec<RecipeIngredient>§result_item_id: u64§result_count: u32§required_level: u32§success_chance: f32§station: CraftingStation§xp_reward: u64Implementations§
Source§impl Recipe
impl Recipe
pub fn new(id: u64, name: impl Into<String>, station: CraftingStation) -> Self
pub fn add_ingredient(self, item_id: u64, count: u32) -> Self
pub fn with_result(self, item_id: u64, count: u32) -> Self
pub fn with_success_chance(self, chance: f32) -> Self
pub fn with_level(self, level: u32) -> Self
pub fn can_craft(&self, inventory: &Inventory, player_level: u32) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Recipe
impl RefUnwindSafe for Recipe
impl Send for Recipe
impl Sync for Recipe
impl Unpin for Recipe
impl UnsafeUnpin for Recipe
impl UnwindSafe for Recipe
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