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LI7OXUGCSXLJZTV36QC
RQRFFUF6EN2RMBL5ITLF4HYJPGNMYXNTV4YNWH2BUCVZQE5KY2AQC
mod floor;
use floor::{Floor, MaterialStorage, Plank, Row};
/// The length of a new plank
//static PLANKMAX: u32 = 2200;
//static PLANKMAX: u32 = 2010;
/// The smallest allowable plank length
//static PLANKMIN: u32 = 200;
//static PLANKWIDTH: u32 = 185;
//static PLAY: u32 = 20;
//static SAWBLADE: u32 = 10;
//static ROOMLENGTH: u32 = 3800;
//static ROOMLENGTH: u32 = 1000;
//static ROOMDEPTH: u32 = 555;
//static ROOMDEPTH: u32 = 2800;
/// The length of a new plank
static PLANKMAX: u32 = 2200;
//static PLANKMAX: u32 = 1900;
/// The smallest allowable plank length
static PLANKMIN: u32 = 200;
static PLANKWIDTH: u32 = 100;
static PLAY: u32 = 5;
static SAWBLADE: u32 = 10;
//static ROOMLENGTH: u32 = 3800;
static ROOMLENGTH: u32 = 5000;
static ROOMDEPTH: u32 = 1000;
//static ROOMDEPTH: u32 = 2800;
use parkett::constants::{
PLANKMAX, PLANKMIN, PLANKWIDTH, PLAY, ROOMDEPTH, ROOMLENGTH, SAWBLADE,
};
use parkett::{Floor, MaterialStorage, Row};
// Create a pool of planks, modify the constant AVAILABLEPLANKS
// to the total number of full length available planks
let ms = MaterialStorage::default();
// Create a pool of planks
// To change, modify constants.rs
let mut ms = MaterialStorage::default();
//println!("MS: {:#?}", ms);
//println!("coverage: {:#?}", floor.get_coverage());
// TODO, deal with unwrap
floor.add(build_row(&mut ms).unwrap());
floor.add_coverage(PLANKWIDTH);
match build_row(&mut ms) {
Some(row) => {
floor.add(row);
floor.add_coverage(PLANKWIDTH);
}
None => {
println!("Error: Unable to add more rows.\nExiting");
return ();
}
}
// Annotate the planks in the beginning and end as endpieces
if let Some(plank) = row.planks_mut().first_mut() {
plank.set_endpiece()
}
if let Some(plank) = row.planks_mut().last_mut() {
plank.set_endpiece()
}
//println!("Row: {:#?}", row);
/// The length of a new plank
pub static PLANKMAX: u32 = 2200;
/// The smallest allowable plank length
pub static PLANKMIN: u32 = 200;
/// Width of a plank
pub static PLANKWIDTH: u32 = 185;
/// Amount of desired play between end planks
/// and the wallss
pub static PLAY: u32 = 5;
/// Size of the sawblade, how much material is lost
pub static SAWBLADE: u32 = 10;
/// Length of the room
pub static ROOMLENGTH: u32 = 4760;
/// Depth of the room
pub static ROOMDEPTH: u32 = 2800;
/// How many planks are available?
pub static AVAILABLEPLANKS: u32 = 30;