Nolan Darilek
957dcca447
I'm finding that, for best results, I need to integrate everything into my map generation process. So for instance, object/monster spawns need to run as a filter so they can influence future steps. This associates a `Clone + Default` type with maps and makes it available to filters. `NoData` exists for the current behavior. All examples/tests/demos have been updated accordingly.
24 lines
515 B
Rust
24 lines
515 B
Rust
use mapgen::{
|
|
MapBuilder,
|
|
NoData,
|
|
filter::{
|
|
NoiseGenerator,
|
|
CellularAutomata,
|
|
CullUnreachable,
|
|
AreaStartingPosition,
|
|
XStart,
|
|
YStart,
|
|
},
|
|
};
|
|
|
|
|
|
fn main() {
|
|
let map = MapBuilder::<NoData>::new(20, 20)
|
|
.with(NoiseGenerator::uniform())
|
|
.with(CellularAutomata::new())
|
|
.with(AreaStartingPosition::new(XStart::CENTER, YStart::CENTER))
|
|
.with(CullUnreachable::new())
|
|
.build();
|
|
|
|
println!("{:}", &map);
|
|
} |