starting in town

This commit is contained in:
Llywelwyn 2023-07-26 01:35:02 +01:00
parent 34e7ec40ee
commit f2fabafe57
9 changed files with 551 additions and 61 deletions

View file

@ -58,6 +58,8 @@ mod door_placement;
use door_placement::DoorPlacement;
mod fill_edges;
use fill_edges::FillEdges;
mod town;
use town::town_builder;
// Shared data to be passed around build chain
pub struct BuilderMap {
@ -314,3 +316,11 @@ pub fn random_builder(new_depth: i32, rng: &mut rltk::RandomNumberGenerator, wid
builder
}
pub fn level_builder(new_depth: i32, rng: &mut rltk::RandomNumberGenerator, width: i32, height: i32) -> BuilderChain {
rltk::console::log(format!("DEBUGINFO: Depth: {}", new_depth));
match new_depth {
1 => town_builder(new_depth, rng, width, height),
_ => random_builder(new_depth, rng, width, height),
}
}