pub struct CraftTracker { /* private fields */ }Expand description
This structure keeps track of the current crafting recipe selected and allows lazy update of the crafting recipe. A crafting recipe is based on a 3x3 item grid.
Implementations§
Source§impl CraftTracker
impl CraftTracker
Sourcepub fn update(&mut self, grid: &[ItemStack; 9])
pub fn update(&mut self, grid: &[ItemStack; 9])
Update this tracker to track a new 3x3 grid of items.
Sourcepub fn consume(&self, grid: &mut [ItemStack; 9])
pub fn consume(&self, grid: &mut [ItemStack; 9])
If there is a selected recipe, consume the recipe items from the given inventory,
this inventory should be coherent with the one that selected this recipe through
the update method. You need to call the update method again in order to update
the tracker for the new inventory.
Trait Implementations§
Source§impl Debug for CraftTracker
impl Debug for CraftTracker
Source§impl Default for CraftTracker
impl Default for CraftTracker
Source§fn default() -> CraftTracker
fn default() -> CraftTracker
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CraftTracker
impl RefUnwindSafe for CraftTracker
impl Send for CraftTracker
impl Sync for CraftTracker
impl Unpin for CraftTracker
impl UnwindSafe for CraftTracker
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