Improve water.rs usability

Will have an accompanying book update
This commit is contained in:
Treeco 2022-05-06 13:12:11 +01:00
parent 005b69edc5
commit 66fe458623
2 changed files with 7 additions and 2 deletions

View File

@ -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,

View File

@ -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 {