Can now build floors

[?]
Jul 11, 2020, 9:35 PM
VSG6UWDYMGCJHOVD5BI5UNAAYLVL6REAAJLI7OXUGCSXLJZTV36QC

Dependencies

  • [2] ZJPL7VNQ Separate planks from main
  • [3] 5TH3AA46 10 mm extra space
  • [4] F3GMCMWT Merge branch 'master' into sovrum
  • [5] 2USDM5CH WIP for more generic
  • [6] 3H2BGWRG WIP
  • [7] MLUGR2LL Add default impl and some basic plank logic
  • [8] RQRFFUF6 Can build the first basic row
  • [9] ES2PMPT4 Using structures instead
  • [10] CT3VONTO Introduce PLANKMIN and work with the neverending rows

Change contents

  • edit in src/floor.rs at line 51
    [2.1152]
    [2.1152]
    } else if measure == 0 {
    panic!("Cutting a plank to length 0 does not make sense!");
  • edit in src/floor.rs at line 54
    [2.1162]
    [2.1162]
  • edit in src/floor.rs at line 86
    [2.1762]
    [2.1762]
    planks_used: u32,
  • edit in src/floor.rs at line 95
    [2.1924]
    [2.1924]
    planks_used: 0,
  • replacement in src/floor.rs at line 158
    [2.3232][2.3232:3272]()
    pub fn is_complete(&self) -> bool {
    [2.3232]
    [2.3272]
    pub fn get_complete(&self) -> bool {
  • edit in src/floor.rs at line 160
    [2.3294]
    [2.3294]
    }
    /// Mark this floor as complete
    pub fn set_complete(&mut self) -> () {
    self.complete = true;
  • edit in src/floor.rs at line 166
    [2.3300]
    [2.3300]
  • edit in src/floor.rs at line 172
    [2.3423]
    [2.3423]
    /// Add another row to this floor
  • edit in src/floor.rs at line 175
    [2.3496]
    [2.3496]
    }
    /// Get the number of plank rows for this floor
    pub fn get_coverage(&self) -> u32 {
    self.coverage
    }
    /// Increase how much of the row is filled
    pub fn add_coverage(&mut self, coverage: u32) -> () {
    self.coverage += coverage;
  • replacement in src/main.rs at line 36
    [3.1297][3.58:65](),[3.65][3.1277:1317](),[3.1297][3.1277:1317]()
    /*
    while floor.coverage <= ROOMDEPTH {
    [3.1297]
    [3.1317]
    while floor.get_coverage() < ROOMDEPTH {
  • replacement in src/main.rs at line 38
    [3.1349][2.3698:3736]()
    floor.coverage += PLANKWIDTH;
    [3.1349]
    [3.1349]
    floor.add_coverage(PLANKWIDTH);
  • replacement in src/main.rs at line 40
    [3.1355][3.66:73]()
    */
    [3.1355]
    [3.449]
    floor.set_complete();
  • edit in src/main.rs at line 42
    [3.450][3.74:102]()
    floor.add(build_row());
  • replacement in src/main.rs at line 52
    [3.1552][2.3737:3782]()
    while row.get_coverage() <= ROOMLENGTH {
    [3.1552]
    [2.3782]
    while row.get_coverage() < ROOMLENGTH {
  • replacement in src/main.rs at line 94
    [3.1979][2.5034:5071]()
    println!("Row: {:#?}", row);
    [3.1979]
    [3.1418]
    //println!("Row: {:#?}", row);