From 66fe458623ad5620936608778ff52aaf9cf77e58 Mon Sep 17 00:00:00 2001 From: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Fri, 6 May 2022 13:12:11 +0100 Subject: [PATCH] Improve water.rs usability Will have an accompanying book update --- world/examples/water.rs | 5 +++-- world/src/sim/mod.rs | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/world/examples/water.rs b/world/examples/water.rs index 13d8e8b6f8..f59e242abf 100644 --- a/world/examples/water.rs +++ b/world/examples/water.rs @@ -47,8 +47,9 @@ fn main() { WorldOpts { seed_elements: false, world_file: sim::FileOpts::LoadAsset(veloren_world::sim::DEFAULT_WORLD_MAP.into()), - /* world_file: sim::FileOpts::Load(_map_file), - * world_file: sim::FileOpts::Save(sim::SizeOpts::default()), */ + // world_file: sim::FileOpts::Load(_map_file), + // world_file: sim::FileOpts::Save(sim::SizeOpts::default()), + // world_file: sim::FileOpts::Save(sim::SizeOpts::new(12, 12, 4.0)), calendar: None, }, &threadpool, diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index bf9d7becb6..f36d3a0640 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -143,6 +143,10 @@ pub struct SizeOpts { scale: f64, } +impl SizeOpts { + pub fn new(x_lg: u32, y_lg: u32, scale: f64) -> Self { Self { x_lg, y_lg, scale } } +} + impl Default for SizeOpts { fn default() -> Self { Self {