drunkards walk
This commit is contained in:
parent
d96d4881d5
commit
363ff4c0a3
5 changed files with 280 additions and 44 deletions
|
|
@ -3,6 +3,7 @@ mod bsp_dungeon;
|
|||
mod bsp_interior;
|
||||
mod cellular_automata;
|
||||
mod common;
|
||||
mod drunkard;
|
||||
mod simple_map;
|
||||
use common::*;
|
||||
use rltk::RandomNumberGenerator;
|
||||
|
|
@ -19,11 +20,14 @@ pub trait MapBuilder {
|
|||
|
||||
pub fn random_builder(new_depth: i32) -> Box<dyn MapBuilder> {
|
||||
let mut rng = rltk::RandomNumberGenerator::new();
|
||||
let builder = rng.roll_dice(1, 4);
|
||||
let builder = rng.roll_dice(1, 7);
|
||||
match builder {
|
||||
1 => Box::new(bsp_dungeon::BspDungeonBuilder::new(new_depth)),
|
||||
2 => Box::new(bsp_interior::BspInteriorBuilder::new(new_depth)),
|
||||
3 => Box::new(cellular_automata::CellularAutomataBuilder::new(new_depth)),
|
||||
4 => Box::new(drunkard::DrunkardsWalkBuilder::open_area(new_depth)),
|
||||
5 => Box::new(drunkard::DrunkardsWalkBuilder::open_halls(new_depth)),
|
||||
6 => Box::new(drunkard::DrunkardsWalkBuilder::winding_passages(new_depth)),
|
||||
_ => Box::new(simple_map::SimpleMapBuilder::new(new_depth)),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue