use super::{Map, Rect, TileType, Position, spawner, SHOW_MAPGEN_VISUALIZER}; mod simple_map; use simple_map::SimpleMapBuilder; mod bsp_dungeon; use bsp_dungeon::BspDungeonBuilder; mod bsp_interior; use bsp_interior::BspInteriorBuilder; mod cellular_automota; use cellular_automota::CellularAutomotaBuilder; mod drunkard; use drunkard::DrunkardsWalkBuilder; mod common; use common::*; use specs::prelude::*; pub trait MapBuilder { fn build_map(&mut self); fn spawn_entities(&mut self, ecs : &mut World); fn get_map(&self) -> Map; fn get_starting_position(&self) -> Position; fn get_snapshot_history(&self) -> Vec; fn take_snapshot(&mut self); } pub fn random_builder(new_depth: i32) -> Box { /*let mut rng = rltk::RandomNumberGenerator::new(); let builder = rng.roll_dice(1, 4); match builder { 1 => Box::new(BspDungeonBuilder::new(new_depth)), 2 => Box::new(BspInteriorBuilder::new(new_depth)), 3 => Box::new(CellularAutomotaBuilder::new(new_depth)), _ => Box::new(SimpleMapBuilder::new(new_depth)) }*/ Box::new(DrunkardsWalkBuilder::new(new_depth)) }