Add support for popping a plank

AfoHT
Jan 26, 2024, 8:47 PM
F37PVGYNMSVNJG2T34JTZNDMFUH552KBNWEHSZUHPQINGBB5L55QC

Dependencies

Change contents

  • edit in src/lib.rs at line 245
    [2.366]
    [2.366]
    /// Remove a plank from this row
    pub fn pop(&mut self, ms: &mut MaterialStorage) {
    // Remove the plank
    if let Some(plank) = self.planks.pop() {
    ms.store_used(plank);
    // Update the row coverage
    self.coverage -= plank.length();
    }
    // Remove the cut
    if let Some(cut) = self.cut_coordinates.pop() {
    println!("Removed cut at {}", cut.coordinate);
    }
    }