map builder module

This commit is contained in:
Llywelwyn 2023-07-15 11:01:50 +01:00
parent 6302951694
commit 7e4953f096
5 changed files with 156 additions and 114 deletions

15
src/map_builders/mod.rs Normal file
View file

@ -0,0 +1,15 @@
use super::{spawner, Map, Position, Rect, TileType};
mod simple_map;
use simple_map::SimpleMapBuilder;
mod common;
use common::*;
use rltk::RandomNumberGenerator;
use specs::prelude::*;
trait MapBuilder {
fn build(rng: &mut RandomNumberGenerator, new_depth: i32) -> (Map, Position);
}
pub fn build_random_map(rng: &mut RandomNumberGenerator, new_depth: i32) -> (Map, Position) {
SimpleMapBuilder::build(rng, new_depth)
}