# HG changeset patch # User alfadur # Date 1541188515 -10800 # Node ID a8e194ae26e8d7f55498c81ffbe683a1c04d540e # Parent 400864ecb9542519b6cf1f56a8b99ae755cf3fdc add basic land template to theme editor diff -r 400864ecb954 -r a8e194ae26e8 rust/theme-editor/src/main.rs --- a/rust/theme-editor/src/main.rs Fri Nov 02 22:50:45 2018 +0300 +++ b/rust/theme-editor/src/main.rs Fri Nov 02 22:55:15 2018 +0300 @@ -76,10 +76,18 @@ Rect::new(rnd(WIDTH as i32), rnd(HEIGHT as i32), rnd(120) + 8, rnd(120) + 8) } +fn land_rect() -> Rect { + Rect::at_origin(SIZE) +} + +fn test_template() -> OutlineTemplate { + OutlineTemplate::new(SIZE) + .with_fill_points(vec![land_rect().center()]) + .add_island(&land_rect().split_at(land_rect().center())) +} + fn init_source() -> LandSource { - let template = OutlineTemplate::new(SIZE) - .with_fill_points((0..32).map(|_| point()).collect()) - .with_islands((0..16).map(|_| vec![rect()]).collect()); + let template = test_template(); let generator = TemplatedLandGenerator::new(template); LandSource::new(generator)