Clean up unused use statements

This commit is contained in:
Timothy Warren 2021-12-15 12:08:23 -05:00
parent fc0843847e
commit ee5e690180
16 changed files with 16 additions and 51 deletions

View File

@ -473,7 +473,7 @@ impl State {
{ {
let mut worldmap_resource = self.ecs.write_resource::<Map>(); let mut worldmap_resource = self.ecs.write_resource::<Map>();
*worldmap_resource = builder.get_map(); *worldmap_resource = builder.get_map();
player_start = builder.get_starting_position().as_mut().unwrap().clone(); player_start = *builder.get_starting_position().as_mut().unwrap();
} }
// Spawn bad guys // Spawn bad guys

View File

@ -22,7 +22,6 @@ use area_starting_points::{AreaStartingPosition, XStart, YStart};
use bsp_dungeon::BspDungeonBuilder; use bsp_dungeon::BspDungeonBuilder;
use bsp_interior::BspInteriorBuilder; use bsp_interior::BspInteriorBuilder;
use cellular_automata::CellularAutomataBuilder; use cellular_automata::CellularAutomataBuilder;
use common::*;
use cull_unreachable::CullUnreachable; use cull_unreachable::CullUnreachable;
use distant_exit::DistantExit; use distant_exit::DistantExit;
use dla::DLABuilder; use dla::DLABuilder;

View File

@ -1,9 +1,8 @@
use rltk::RandomNumberGenerator; use rltk::RandomNumberGenerator;
use crate::components::Position;
use crate::map_builders::common::{apply_room_to_map, draw_corridor}; use crate::map_builders::common::{apply_room_to_map, draw_corridor};
use crate::map_builders::{BuilderMap, InitialMapBuilder}; use crate::map_builders::{BuilderMap, InitialMapBuilder};
use crate::{spawner, Map, Rect, TileType, SHOW_MAPGEN_VISUALIZER}; use crate::{Map, Rect, TileType};
pub struct BspDungeonBuilder { pub struct BspDungeonBuilder {
rects: Vec<Rect>, rects: Vec<Rect>,

View File

@ -1,10 +1,8 @@
use rltk::RandomNumberGenerator; use rltk::RandomNumberGenerator;
use super::MapBuilder;
use crate::components::Position;
use crate::map_builders::common::draw_corridor; use crate::map_builders::common::draw_corridor;
use crate::map_builders::{BuilderMap, InitialMapBuilder}; use crate::map_builders::{BuilderMap, InitialMapBuilder};
use crate::{spawner, Map, Rect, TileType, SHOW_MAPGEN_VISUALIZER}; use crate::{Rect, TileType};
const MIN_ROOM_SIZE: i32 = 8; const MIN_ROOM_SIZE: i32 = 8;

View File

@ -1,13 +1,7 @@
use std::collections::HashMap;
use rltk::RandomNumberGenerator; use rltk::RandomNumberGenerator;
use crate::components::Position;
use crate::map_builders::common::{
generate_voronoi_spawn_regions, remove_unreachable_areas_returning_most_distant,
};
use crate::map_builders::{BuilderMap, InitialMapBuilder}; use crate::map_builders::{BuilderMap, InitialMapBuilder};
use crate::{spawner, Map, TileType, SHOW_MAPGEN_VISUALIZER}; use crate::TileType;
pub struct CellularAutomataBuilder {} pub struct CellularAutomataBuilder {}

View File

@ -1,5 +1,4 @@
use std::cmp::{max, min}; use std::cmp::{max, min};
use std::collections::HashMap;
use crate::{Map, Rect, TileType}; use crate::{Map, Rect, TileType};

View File

@ -18,7 +18,7 @@ impl CullUnreachable {
} }
fn build(&mut self, _rng: &mut RandomNumberGenerator, build_data: &mut BuilderMap) { fn build(&mut self, _rng: &mut RandomNumberGenerator, build_data: &mut BuilderMap) {
let starting_pos = build_data.starting_position.as_ref().unwrap().clone(); let starting_pos = *build_data.starting_position.as_ref().unwrap();
let start_idx = build_data.map.xy_idx(starting_pos.x, starting_pos.y); let start_idx = build_data.map.xy_idx(starting_pos.x, starting_pos.y);
build_data.map.populate_blocked(); build_data.map.populate_blocked();

View File

@ -18,7 +18,7 @@ impl DistantExit {
} }
fn build(&mut self, _rng: &mut RandomNumberGenerator, build_data: &mut BuilderMap) { fn build(&mut self, _rng: &mut RandomNumberGenerator, build_data: &mut BuilderMap) {
let starting_pos = build_data.starting_position.as_ref().unwrap().clone(); let starting_pos = *build_data.starting_position.as_ref().unwrap();
let start_idx = build_data.map.xy_idx(starting_pos.x, starting_pos.y); let start_idx = build_data.map.xy_idx(starting_pos.x, starting_pos.y);
build_data.map.populate_blocked(); build_data.map.populate_blocked();

View File

@ -1,15 +1,9 @@
use std::collections::HashMap;
use rltk::RandomNumberGenerator; use rltk::RandomNumberGenerator;
use super::common::{ use super::common::{paint, Symmetry};
generate_voronoi_spawn_regions, paint, remove_unreachable_areas_returning_most_distant,
Symmetry,
};
use super::MapBuilder;
use crate::components::Position; use crate::components::Position;
use crate::map_builders::{BuilderMap, InitialMapBuilder}; use crate::map_builders::{BuilderMap, InitialMapBuilder};
use crate::{spawner, Map, TileType, SHOW_MAPGEN_VISUALIZER}; use crate::TileType;
#[derive(PartialEq, Copy, Clone)] #[derive(PartialEq, Copy, Clone)]
pub enum DLAAlgorithm { pub enum DLAAlgorithm {

View File

@ -1,15 +1,9 @@
use std::collections::HashMap;
use rltk::RandomNumberGenerator; use rltk::RandomNumberGenerator;
use super::common::{ use super::common::{paint, Symmetry};
generate_voronoi_spawn_regions, paint, remove_unreachable_areas_returning_most_distant,
Symmetry,
};
use super::MapBuilder;
use crate::components::Position; use crate::components::Position;
use crate::map_builders::{BuilderMap, InitialMapBuilder}; use crate::map_builders::{BuilderMap, InitialMapBuilder};
use crate::{spawner, Map, TileType, SHOW_MAPGEN_VISUALIZER}; use crate::TileType;
#[derive(PartialEq, Copy, Clone)] #[derive(PartialEq, Copy, Clone)]
pub enum DrunkSpawnMode { pub enum DrunkSpawnMode {

View File

@ -1,13 +1,9 @@
use std::cmp::{max, min}; use std::cmp::{max, min};
use std::collections::HashMap;
use rltk::RandomNumberGenerator; use rltk::RandomNumberGenerator;
use super::{
generate_voronoi_spawn_regions, remove_unreachable_areas_returning_most_distant, MapBuilder,
};
use crate::map_builders::{BuilderMap, InitialMapBuilder}; use crate::map_builders::{BuilderMap, InitialMapBuilder};
use crate::{spawner, Map, Position, TileType, SHOW_MAPGEN_VISUALIZER}; use crate::{Map, TileType};
pub struct MazeBuilder {} pub struct MazeBuilder {}

View File

@ -7,7 +7,7 @@ use std::collections::HashSet;
use rltk::RandomNumberGenerator; use rltk::RandomNumberGenerator;
use crate::map_builders::{BuilderMap, InitialMapBuilder, MetaMapBuilder}; use crate::map_builders::{BuilderMap, InitialMapBuilder, MetaMapBuilder};
use crate::{Map, Position, TileType, SHOW_MAPGEN_VISUALIZER}; use crate::{Position, TileType};
#[derive(PartialEq, Copy, Clone)] #[derive(PartialEq, Copy, Clone)]
#[allow(dead_code)] #[allow(dead_code)]

View File

@ -4,7 +4,7 @@ use crate::map_builders::common::{
apply_horizontal_tunnel, apply_room_to_map, apply_vertical_tunnel, apply_horizontal_tunnel, apply_room_to_map, apply_vertical_tunnel,
}; };
use crate::map_builders::{BuilderMap, InitialMapBuilder}; use crate::map_builders::{BuilderMap, InitialMapBuilder};
use crate::{spawner, Map, Position, Rect, TileType, SHOW_MAPGEN_VISUALIZER}; use crate::Rect;
pub struct SimpleMapBuilder {} pub struct SimpleMapBuilder {}

View File

@ -1,10 +1,7 @@
use std::collections::HashMap;
use rltk::RandomNumberGenerator; use rltk::RandomNumberGenerator;
use crate::components::Position;
use crate::map_builders::{BuilderMap, InitialMapBuilder}; use crate::map_builders::{BuilderMap, InitialMapBuilder};
use crate::{spawner, Map, TileType, SHOW_MAPGEN_VISUALIZER}; use crate::TileType;
#[derive(PartialEq, Copy, Clone)] #[derive(PartialEq, Copy, Clone)]
#[allow(dead_code)] #[allow(dead_code)]

View File

@ -19,6 +19,7 @@ impl VoronoiSpawning {
Box::new(VoronoiSpawning {}) Box::new(VoronoiSpawning {})
} }
#[allow(clippy::map_entry)]
fn build(&mut self, rng: &mut RandomNumberGenerator, build_data: &mut BuilderMap) { fn build(&mut self, rng: &mut RandomNumberGenerator, build_data: &mut BuilderMap) {
let mut noise_areas: HashMap<i32, Vec<usize>> = HashMap::new(); let mut noise_areas: HashMap<i32, Vec<usize>> = HashMap::new();
let mut noise = rltk::FastNoise::seeded(rng.roll_dice(1, 65536) as u64); let mut noise = rltk::FastNoise::seeded(rng.roll_dice(1, 65536) as u64);

View File

@ -2,19 +2,13 @@ mod common;
mod constraints; mod constraints;
mod solver; mod solver;
use std::collections::HashMap;
use common::*; use common::*;
use constraints::*; use constraints::*;
use rltk::RandomNumberGenerator; use rltk::RandomNumberGenerator;
use solver::*; use solver::*;
use super::common::{
generate_voronoi_spawn_regions, remove_unreachable_areas_returning_most_distant,
};
use super::MapBuilder;
use crate::map_builders::{BuilderMap, MetaMapBuilder}; use crate::map_builders::{BuilderMap, MetaMapBuilder};
use crate::{spawner, Map, Position, TileType, SHOW_MAPGEN_VISUALIZER}; use crate::Map;
pub struct WaveformCollapseBuilder {} pub struct WaveformCollapseBuilder {}