diff --git a/src/map_builders/mod.rs b/src/map_builders/mod.rs index 3dc5c91..9ae675b 100644 --- a/src/map_builders/mod.rs +++ b/src/map_builders/mod.rs @@ -1,7 +1,9 @@ +mod bsp_dungeon; mod common; mod simple_map; use crate::{Map, Position}; +use bsp_dungeon::BspDungeonBuilder; use common::*; use simple_map::SimpleMapBuilder; use specs::prelude::*; @@ -16,6 +18,9 @@ pub trait MapBuilder { } pub fn random_builder(new_depth: i32) -> Box { - // Note that until we have a second map type, this isn't even slightly random - Box::new(SimpleMapBuilder::new(new_depth)) + let mut rng = rltk::RandomNumberGenerator::new(); + match rng.roll_dice(1, 2) { + 1 => Box::new(BspDungeonBuilder::new(new_depth)), + _ => Box::new(SimpleMapBuilder::new(new_depth)), + } }