here_be_dragons/examples/bsp_rooms.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

12 lines
396 B
Rust

use std::time::{SystemTime, UNIX_EPOCH};
use rand::prelude::*;
use mapgen::*;
fn main() {
let system_time = SystemTime::now().duration_since(UNIX_EPOCH).expect("Can't access system time");
let mut rng = StdRng::seed_from_u64(system_time.as_millis() as u64);
let gen = BspRooms::<NoData>::new();
let map = gen.modify_map(&mut rng, &Map::new(80, 50));
println!("{:}", &map);
}