map builder module
This commit is contained in:
parent
6302951694
commit
7e4953f096
5 changed files with 156 additions and 114 deletions
15
src/map_builders/mod.rs
Normal file
15
src/map_builders/mod.rs
Normal 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)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue