2021-12-01 10:47:41 -05:00
|
|
|
mod common;
|
|
|
|
mod simple_map;
|
|
|
|
|
2021-12-01 11:02:39 -05:00
|
|
|
use crate::{Map, Position};
|
2021-12-01 10:47:41 -05:00
|
|
|
use common::*;
|
|
|
|
use simple_map::SimpleMapBuilder;
|
2021-12-01 11:41:29 -05:00
|
|
|
use specs::prelude::*;
|
2021-12-01 10:47:41 -05:00
|
|
|
|
2021-12-01 11:41:29 -05:00
|
|
|
pub trait MapBuilder {
|
|
|
|
fn build_map(&mut self, new_depth: i32) -> (Map, Position);
|
|
|
|
fn spawn_entities(&mut self, map: &Map, ecs: &mut World, new_depth: i32);
|
2021-12-01 10:47:41 -05:00
|
|
|
}
|
|
|
|
|
2021-12-01 11:41:29 -05:00
|
|
|
pub fn random_builder() -> Box<dyn MapBuilder> {
|
|
|
|
// Note that until we have a second map type, this isn't even slightly random
|
|
|
|
Box::new(SimpleMapBuilder {})
|
2021-12-01 10:47:41 -05:00
|
|
|
}
|