here_be_dragons/examples/example1.rs
Nolan Darilek 957dcca447 Add ability to associate arbitrary BuilderData with maps.
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.
2022-03-12 09:45:42 -06:00

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);
}