roguelike-game/src/map_builders/mod.rs

18 lines
465 B
Rust
Raw Normal View History

mod common;
mod simple_map;
use crate::{Map, Position};
use common::*;
use simple_map::SimpleMapBuilder;
use specs::prelude::*;
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);
}
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 {})
}