Fix some linting issues

This commit is contained in:
Timothy Warren 2021-12-14 14:15:22 -05:00
parent cce44f78f4
commit 99d5a78512
11 changed files with 14 additions and 13 deletions

View File

@ -1,5 +1,4 @@
use rltk::RandomNumberGenerator;
use specs::prelude::*;
use super::MapBuilder;
use crate::components::Position;

View File

@ -1,5 +1,4 @@
use rltk::RandomNumberGenerator;
use specs::prelude::*;
use super::MapBuilder;
use crate::components::Position;

View File

@ -1,7 +1,6 @@
use std::collections::HashMap;
use rltk::RandomNumberGenerator;
use specs::prelude::*;
use super::common::{
generate_voronoi_spawn_regions, remove_unreachable_areas_returning_most_distant,

View File

@ -1,7 +1,6 @@
use std::collections::HashMap;
use rltk::RandomNumberGenerator;
use specs::prelude::*;
use super::common::{
generate_voronoi_spawn_regions, paint, remove_unreachable_areas_returning_most_distant,

View File

@ -1,7 +1,6 @@
use std::collections::HashMap;
use rltk::RandomNumberGenerator;
use specs::prelude::*;
use super::common::{
generate_voronoi_spawn_regions, paint, remove_unreachable_areas_returning_most_distant,

View File

@ -2,7 +2,6 @@ use std::cmp::{max, min};
use std::collections::HashMap;
use rltk::RandomNumberGenerator;
use specs::prelude::*;
use super::{
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
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,
);
}
}
}

View File

@ -5,7 +5,6 @@ pub mod prefab_sections;
use std::collections::HashSet;
use rltk::RandomNumberGenerator;
use specs::prelude::*;
use super::{remove_unreachable_areas_returning_most_distant, MapBuilder};
use crate::{spawner, Map, Position, TileType, SHOW_MAPGEN_VISUALIZER};
@ -140,7 +139,7 @@ impl PrefabBuilder {
fn build(&mut self) {
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::Sectional { section } => self.apply_sectional(&section),
PrefabMode::RoomVaults => self.apply_room_vaults(),
@ -283,7 +282,7 @@ impl PrefabBuilder {
let prev_builder = self.previous_builder.as_mut().unwrap();
prev_builder.build_map();
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();
for e in prev_builder.get_spawn_list().iter() {
let idx = e.0;

View File

@ -1,5 +1,4 @@
use rltk::RandomNumberGenerator;
use specs::prelude::*;
use super::{apply_horizontal_tunnel, apply_room_to_map, apply_vertical_tunnel, MapBuilder};
use crate::{spawner, Map, Position, Rect, TileType, SHOW_MAPGEN_VISUALIZER};

View File

@ -1,7 +1,6 @@
use std::collections::HashMap;
use rltk::RandomNumberGenerator;
use specs::prelude::*;
use super::common::{
generate_voronoi_spawn_regions, remove_unreachable_areas_returning_most_distant,

View File

@ -8,7 +8,6 @@ use common::*;
use constraints::*;
use rltk::RandomNumberGenerator;
use solver::*;
use specs::prelude::*;
use super::common::{
generate_voronoi_spawn_regions, remove_unreachable_areas_returning_most_distant,

View File

@ -85,7 +85,7 @@ pub fn spawn_room(
}
pub fn spawn_region(
map: &Map,
_map: &Map,
rng: &mut RandomNumberGenerator,
area: &[usize],
map_depth: i32,