Clean up code (fix warnings)
This commit is contained in:
parent
642f815f9d
commit
8e268f7612
4 changed files with 12 additions and 24 deletions
|
|
@ -1,3 +1,4 @@
|
|||
use crate::{BlueprintEntity, BlueprintPosition};
|
||||
use factorio_core::{
|
||||
aabb::AABB,
|
||||
beltoptions::Beltspeed,
|
||||
|
|
@ -7,12 +8,7 @@ use factorio_core::{
|
|||
quaterdirection::QuaterDirection,
|
||||
visualize::{Color, Visualization},
|
||||
};
|
||||
use std::{
|
||||
collections::{HashMap, HashSet},
|
||||
sync::atomic::AtomicUsize,
|
||||
};
|
||||
|
||||
use crate::{BlueprintEntity, BlueprintPosition};
|
||||
use std::{collections::HashMap, sync::atomic::AtomicUsize};
|
||||
|
||||
mod power_connection;
|
||||
mod visualize;
|
||||
|
|
@ -386,7 +382,7 @@ impl Entity {
|
|||
}
|
||||
fn visualize(&self, v: &mut Visualization, offset: Position) {
|
||||
match &self.entity {
|
||||
EntityType::Belt(beltspeed) => {
|
||||
EntityType::Belt(_beltspeed) => {
|
||||
v.add_symbol(
|
||||
(self.position - Position::new(1, 1)) / 2 + offset,
|
||||
factorio_core::visualize::Symbol::Arrow(self.direction.unwrap_dir()),
|
||||
|
|
@ -394,7 +390,7 @@ impl Entity {
|
|||
None,
|
||||
);
|
||||
}
|
||||
EntityType::UndergroundBelt(beltspeed, underground_type) => match underground_type {
|
||||
EntityType::UndergroundBelt(_beltspeed, underground_type) => match underground_type {
|
||||
UndergroundType::Input => {
|
||||
v.add_symbol(
|
||||
(self.position - Position::new(1, 1)) / 2 + offset,
|
||||
|
|
@ -412,7 +408,7 @@ impl Entity {
|
|||
);
|
||||
}
|
||||
},
|
||||
EntityType::Splitter(beltspeed) => (),
|
||||
EntityType::Splitter(_beltspeed) => (),
|
||||
EntityType::ElectricPole(electric_pole_type) => match electric_pole_type {
|
||||
ElectricPoleType::Small => v.add_symbol(
|
||||
(self.position - Position::new(1, 1)) / 2 + offset,
|
||||
|
|
@ -447,13 +443,7 @@ impl Entity {
|
|||
}
|
||||
}
|
||||
},
|
||||
EntityType::Inserter {
|
||||
inserter_type,
|
||||
override_stack_size,
|
||||
} => (),
|
||||
EntityType::Production { name, recipe, size } => (),
|
||||
EntityType::Rail { rail_type } => (),
|
||||
EntityType::Unknown { name, size, misc } => (),
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -627,7 +617,7 @@ impl Blueprint {
|
|||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
struct Placibility {
|
||||
pub struct Placibility {
|
||||
blocked: PositionMap<bool>,
|
||||
}
|
||||
|
||||
|
|
@ -637,7 +627,7 @@ impl Placibility {
|
|||
for y in aabb.min().y..=aabb.max().y {
|
||||
for x in aabb.min().x..=aabb.max().x {
|
||||
if !self.blocked.get_aabb().contains_pos(Position::new(x, y))
|
||||
|| self.blocked[Position::new(x, y)] == true
|
||||
|| self.blocked[Position::new(x, y)]
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
use factorio_core::visualize::Visualize;
|
||||
use factorio_graph::{
|
||||
priority_queue::binary_heap::FastBinaryHeap,
|
||||
wheighted_graph::{WheightedGraph, steiner_tree},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue