generic goto_level, implements backtracking

This commit is contained in:
Llywelwyn 2023-08-13 09:21:07 +01:00
parent 25befa9343
commit dab0683ffd
6 changed files with 44 additions and 29 deletions

View file

@ -12,7 +12,7 @@ pub fn forest_builder(
difficulty: i32,
initial_player_level: i32,
) -> BuilderChain {
let mut chain = BuilderChain::new(new_id, width, height, difficulty, "Into the Woods", initial_player_level);
let mut chain = BuilderChain::new(new_id, width, height, difficulty, "the woods", initial_player_level);
chain.start_with(CellularAutomataBuilder::new());
chain.with(AreaStartingPosition::new(XStart::CENTRE, YStart::CENTRE));
chain.with(CullUnreachable::new());

View file

@ -308,7 +308,7 @@ pub fn random_builder(
initial_player_level: i32,
) -> BuilderChain {
rltk::console::log(format!("DEBUGINFO: Building random (ID:{}, DIFF:{})", new_id, difficulty));
let mut builder = BuilderChain::new(new_id, width, height, difficulty, "<PLACEHOLDER>", initial_player_level);
let mut builder = BuilderChain::new(new_id, width, height, difficulty, "the dungeon", initial_player_level);
let type_roll = rng.roll_dice(1, 2);
let mut want_doors = true;
match type_roll {

View file

@ -10,7 +10,7 @@ pub fn town_builder(
initial_player_level: i32,
) -> BuilderChain {
rltk::console::log(format!("DEBUGINFO: Building town (ID:{}, DIFF:{})", new_id, difficulty));
let mut chain = BuilderChain::new(new_id, width, height, difficulty, "<PLACEHOLDER>", initial_player_level);
let mut chain = BuilderChain::new(new_id, width, height, difficulty, "the town", initial_player_level);
chain.start_with(TownBuilder::new());
return chain;