Fix some linting issues
This commit is contained in:
parent
cce44f78f4
commit
99d5a78512
@ -1,5 +1,4 @@
|
|||||||
use rltk::RandomNumberGenerator;
|
use rltk::RandomNumberGenerator;
|
||||||
use specs::prelude::*;
|
|
||||||
|
|
||||||
use super::MapBuilder;
|
use super::MapBuilder;
|
||||||
use crate::components::Position;
|
use crate::components::Position;
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
use rltk::RandomNumberGenerator;
|
use rltk::RandomNumberGenerator;
|
||||||
use specs::prelude::*;
|
|
||||||
|
|
||||||
use super::MapBuilder;
|
use super::MapBuilder;
|
||||||
use crate::components::Position;
|
use crate::components::Position;
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use rltk::RandomNumberGenerator;
|
use rltk::RandomNumberGenerator;
|
||||||
use specs::prelude::*;
|
|
||||||
|
|
||||||
use super::common::{
|
use super::common::{
|
||||||
generate_voronoi_spawn_regions, remove_unreachable_areas_returning_most_distant,
|
generate_voronoi_spawn_regions, remove_unreachable_areas_returning_most_distant,
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use rltk::RandomNumberGenerator;
|
use rltk::RandomNumberGenerator;
|
||||||
use specs::prelude::*;
|
|
||||||
|
|
||||||
use super::common::{
|
use super::common::{
|
||||||
generate_voronoi_spawn_regions, paint, remove_unreachable_areas_returning_most_distant,
|
generate_voronoi_spawn_regions, paint, remove_unreachable_areas_returning_most_distant,
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use rltk::RandomNumberGenerator;
|
use rltk::RandomNumberGenerator;
|
||||||
use specs::prelude::*;
|
|
||||||
|
|
||||||
use super::common::{
|
use super::common::{
|
||||||
generate_voronoi_spawn_regions, paint, remove_unreachable_areas_returning_most_distant,
|
generate_voronoi_spawn_regions, paint, remove_unreachable_areas_returning_most_distant,
|
||||||
|
@ -2,7 +2,6 @@ use std::cmp::{max, min};
|
|||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use rltk::RandomNumberGenerator;
|
use rltk::RandomNumberGenerator;
|
||||||
use specs::prelude::*;
|
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
generate_voronoi_spawn_regions, remove_unreachable_areas_returning_most_distant, MapBuilder,
|
generate_voronoi_spawn_regions, remove_unreachable_areas_returning_most_distant, MapBuilder,
|
||||||
@ -90,6 +89,17 @@ impl MazeBuilder {
|
|||||||
|
|
||||||
// Now we build a noise map for use in spawning entities later
|
// Now we build a noise map for use in spawning entities later
|
||||||
self.noise_areas = generate_voronoi_spawn_regions(&self.map, &mut rng);
|
self.noise_areas = generate_voronoi_spawn_regions(&self.map, &mut rng);
|
||||||
|
|
||||||
|
// Spawn the entities
|
||||||
|
for area in self.noise_areas.iter() {
|
||||||
|
spawner::spawn_region(
|
||||||
|
&self.map,
|
||||||
|
&mut rng,
|
||||||
|
area.1,
|
||||||
|
self.depth,
|
||||||
|
&mut self.spawn_list,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,6 @@ pub mod prefab_sections;
|
|||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
|
|
||||||
use rltk::RandomNumberGenerator;
|
use rltk::RandomNumberGenerator;
|
||||||
use specs::prelude::*;
|
|
||||||
|
|
||||||
use super::{remove_unreachable_areas_returning_most_distant, MapBuilder};
|
use super::{remove_unreachable_areas_returning_most_distant, MapBuilder};
|
||||||
use crate::{spawner, Map, Position, TileType, SHOW_MAPGEN_VISUALIZER};
|
use crate::{spawner, Map, Position, TileType, SHOW_MAPGEN_VISUALIZER};
|
||||||
@ -140,7 +139,7 @@ impl PrefabBuilder {
|
|||||||
|
|
||||||
fn build(&mut self) {
|
fn build(&mut self) {
|
||||||
match self.mode {
|
match self.mode {
|
||||||
PrefabMode::RexLevel { template } => self.load_rex_map(&template),
|
PrefabMode::RexLevel { template } => self.load_rex_map(template),
|
||||||
PrefabMode::Constant { level } => self.load_ascii_map(&level),
|
PrefabMode::Constant { level } => self.load_ascii_map(&level),
|
||||||
PrefabMode::Sectional { section } => self.apply_sectional(§ion),
|
PrefabMode::Sectional { section } => self.apply_sectional(§ion),
|
||||||
PrefabMode::RoomVaults => self.apply_room_vaults(),
|
PrefabMode::RoomVaults => self.apply_room_vaults(),
|
||||||
@ -283,7 +282,7 @@ impl PrefabBuilder {
|
|||||||
let prev_builder = self.previous_builder.as_mut().unwrap();
|
let prev_builder = self.previous_builder.as_mut().unwrap();
|
||||||
prev_builder.build_map();
|
prev_builder.build_map();
|
||||||
self.starting_position = prev_builder.get_starting_position();
|
self.starting_position = prev_builder.get_starting_position();
|
||||||
self.map = prev_builder.get_map().clone();
|
self.map = prev_builder.get_map();
|
||||||
self.history = prev_builder.get_snapshot_history();
|
self.history = prev_builder.get_snapshot_history();
|
||||||
for e in prev_builder.get_spawn_list().iter() {
|
for e in prev_builder.get_spawn_list().iter() {
|
||||||
let idx = e.0;
|
let idx = e.0;
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
use rltk::RandomNumberGenerator;
|
use rltk::RandomNumberGenerator;
|
||||||
use specs::prelude::*;
|
|
||||||
|
|
||||||
use super::{apply_horizontal_tunnel, apply_room_to_map, apply_vertical_tunnel, MapBuilder};
|
use super::{apply_horizontal_tunnel, apply_room_to_map, apply_vertical_tunnel, MapBuilder};
|
||||||
use crate::{spawner, Map, Position, Rect, TileType, SHOW_MAPGEN_VISUALIZER};
|
use crate::{spawner, Map, Position, Rect, TileType, SHOW_MAPGEN_VISUALIZER};
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use rltk::RandomNumberGenerator;
|
use rltk::RandomNumberGenerator;
|
||||||
use specs::prelude::*;
|
|
||||||
|
|
||||||
use super::common::{
|
use super::common::{
|
||||||
generate_voronoi_spawn_regions, remove_unreachable_areas_returning_most_distant,
|
generate_voronoi_spawn_regions, remove_unreachable_areas_returning_most_distant,
|
||||||
|
@ -8,7 +8,6 @@ use common::*;
|
|||||||
use constraints::*;
|
use constraints::*;
|
||||||
use rltk::RandomNumberGenerator;
|
use rltk::RandomNumberGenerator;
|
||||||
use solver::*;
|
use solver::*;
|
||||||
use specs::prelude::*;
|
|
||||||
|
|
||||||
use super::common::{
|
use super::common::{
|
||||||
generate_voronoi_spawn_regions, remove_unreachable_areas_returning_most_distant,
|
generate_voronoi_spawn_regions, remove_unreachable_areas_returning_most_distant,
|
||||||
|
@ -85,7 +85,7 @@ pub fn spawn_room(
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn spawn_region(
|
pub fn spawn_region(
|
||||||
map: &Map,
|
_map: &Map,
|
||||||
rng: &mut RandomNumberGenerator,
|
rng: &mut RandomNumberGenerator,
|
||||||
area: &[usize],
|
area: &[usize],
|
||||||
map_depth: i32,
|
map_depth: i32,
|
||||||
|
Loading…
Reference in New Issue
Block a user