Add method swapping planks in a row

AfoHT
Jan 26, 2024, 10:15 PM
HRZA4USGOEZALHHGDJA5ZYKJOEGZ7AT6YZ3DVF5W65WSN73DF3TQC

Dependencies

Change contents

  • edit in src/lib.rs at line 253
    [5.366]
    [2.0]
    /// Swap the topmost plank
    pub fn swap_latest(&mut self, ms: &mut MaterialStorage) {
    let number_of_planks = self.planks.len();
    if number_of_planks >= 2 {
    self.pop(ms);
    self.pop(ms);
    if let Some(plank) = ms.get_used() {
    self.add(plank);
    }
    if let Some(plank) = ms.get_used() {
    self.add(plank);
    }
    }
    }