use nightshade::prelude::*;
#[cfg(feature = "terrain")]
pub fn enable_terrain(world: &mut World, seed: u32) {
world.resources.terrain.enabled = true;
world.resources.terrain.seed = seed;
world.resources.terrain.revision += 1;
}
#[cfg(feature = "terrain")]
pub fn disable_terrain(world: &mut World) {
world.resources.terrain.enabled = false;
world.resources.terrain.revision += 1;
}
#[cfg(feature = "terrain")]
pub fn set_terrain_height_range(world: &mut World, min: f32, max: f32) {
world.resources.terrain.height_min = min;
world.resources.terrain.height_max = max;
world.resources.terrain.revision += 1;
}
#[cfg(feature = "terrain")]
pub fn set_terrain_snow_height(world: &mut World, height: f32) {
world.resources.terrain.snow_height = height;
world.resources.terrain.revision += 1;
}
#[cfg(feature = "grass")]
pub fn enable_grass(world: &mut World) {
use nightshade::ecs::grass::{GrassDomain, GrassTypeParams};
world.resources.grass.enabled = true;
world.resources.grass.domain = GrassDomain::Infinite;
if world.resources.grass.types.is_empty() {
world.resources.grass.types = vec![GrassTypeParams::meadow()];
world.resources.grass.types_revision += 1;
}
}
#[cfg(feature = "grass")]
pub fn disable_grass(world: &mut World) {
world.resources.grass.enabled = false;
}