finishes decoupling map from camera
This commit is contained in:
parent
2ecfd25d95
commit
7f0465da73
13 changed files with 110 additions and 254 deletions
|
|
@ -65,6 +65,8 @@ pub struct BuilderMap {
|
|||
pub rooms: Option<Vec<Rect>>,
|
||||
pub corridors: Option<Vec<Vec<usize>>>,
|
||||
pub history: Vec<Map>,
|
||||
pub width: i32,
|
||||
pub height: i32,
|
||||
}
|
||||
|
||||
impl BuilderMap {
|
||||
|
|
@ -86,17 +88,19 @@ pub struct BuilderChain {
|
|||
}
|
||||
|
||||
impl BuilderChain {
|
||||
pub fn new(new_depth: i32) -> BuilderChain {
|
||||
pub fn new(new_depth: i32, width: i32, height: i32) -> BuilderChain {
|
||||
BuilderChain {
|
||||
starter: None,
|
||||
builders: Vec::new(),
|
||||
build_data: BuilderMap {
|
||||
spawn_list: Vec::new(),
|
||||
map: Map::new(new_depth),
|
||||
map: Map::new(new_depth, width, height),
|
||||
starting_position: None,
|
||||
rooms: None,
|
||||
corridors: None,
|
||||
history: Vec::new(),
|
||||
width: width,
|
||||
height: height,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
@ -166,7 +170,7 @@ fn random_room_builder(rng: &mut rltk::RandomNumberGenerator, builder: &mut Buil
|
|||
let build_roll = rng.roll_dice(1, 3);
|
||||
// Start with a room builder.
|
||||
match build_roll {
|
||||
1 => builder.start_with(SimpleMapBuilder::new()),
|
||||
1 => builder.start_with(SimpleMapBuilder::new(None)),
|
||||
2 => builder.start_with(BspDungeonBuilder::new()),
|
||||
_ => builder.start_with(BspInteriorBuilder::new()),
|
||||
}
|
||||
|
|
@ -271,8 +275,8 @@ fn random_shape_builder(rng: &mut rltk::RandomNumberGenerator, builder: &mut Bui
|
|||
builder.with(DistantExit::new());
|
||||
}
|
||||
|
||||
pub fn random_builder(new_depth: i32, rng: &mut rltk::RandomNumberGenerator) -> BuilderChain {
|
||||
/*let mut builder = BuilderChain::new(new_depth);
|
||||
pub fn random_builder(new_depth: i32, rng: &mut rltk::RandomNumberGenerator, width: i32, height: i32) -> BuilderChain {
|
||||
let mut builder = BuilderChain::new(new_depth, width, height);
|
||||
let type_roll = rng.roll_dice(1, 2);
|
||||
match type_roll {
|
||||
1 => random_room_builder(rng, &mut builder),
|
||||
|
|
@ -298,14 +302,5 @@ pub fn random_builder(new_depth: i32, rng: &mut rltk::RandomNumberGenerator) ->
|
|||
builder.with(DoorPlacement::new());
|
||||
builder.with(PrefabBuilder::vaults());
|
||||
|
||||
builder*/
|
||||
|
||||
let mut builder = BuilderChain::new(new_depth);
|
||||
builder.start_with(BspInteriorBuilder::new());
|
||||
builder.with(DoorPlacement::new());
|
||||
builder.with(RoomBasedSpawner::new());
|
||||
builder.with(PrefabBuilder::vaults());
|
||||
builder.with(RoomBasedStairs::new());
|
||||
builder.with(RoomBasedStartingPosition::new());
|
||||
builder
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue