Appease Clippy and fix gnarly visibility error.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Nolan Darilek 2022-03-25 01:00:30 -05:00
parent 23f24136fd
commit bc24308fa1
8 changed files with 13 additions and 18 deletions

View File

@ -5,7 +5,6 @@ use bevy_input_actionmap::InputMap;
use bevy_rapier2d::prelude::*; use bevy_rapier2d::prelude::*;
use bevy_tts::Tts; use bevy_tts::Tts;
use derive_more::{Deref, DerefMut}; use derive_more::{Deref, DerefMut};
use here_be_dragons::Tile;
use crate::{ use crate::{
core::{Coordinates, Player, PointLike}, core::{Coordinates, Player, PointLike},

View File

@ -1,4 +1,4 @@
#![allow(unused_imports)] #![allow(clippy::needless_range_loop)]
#![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_arguments)]
#![allow(clippy::type_complexity)] #![allow(clippy::type_complexity)]

View File

@ -24,9 +24,12 @@ pub struct LogEntry {
pub message: String, pub message: String,
} }
impl Into<String> for LogEntry { impl From<String> for LogEntry {
fn into(self) -> String { fn from(string: String) -> Self {
self.message LogEntry {
time: Instant::now(),
message: string,
}
} }
} }

View File

@ -1,7 +1,4 @@
use std::{ use std::marker::PhantomData;
collections::{HashMap, HashSet},
marker::PhantomData,
};
use bevy::prelude::*; use bevy::prelude::*;
use bevy_rapier2d::prelude::*; use bevy_rapier2d::prelude::*;

View File

@ -1,7 +1,4 @@
use std::{ use std::{error::Error, f32::consts::PI, fmt::Debug, hash::Hash, marker::PhantomData};
collections::HashMap, error::Error, f32::consts::PI, fmt::Debug, hash::Hash,
marker::PhantomData,
};
use bevy::prelude::*; use bevy::prelude::*;
use bevy_input_actionmap::InputMap; use bevy_input_actionmap::InputMap;

View File

@ -12,7 +12,7 @@ use bevy_rapier2d::{
}; };
use derive_more::{Deref, DerefMut}; use derive_more::{Deref, DerefMut};
use futures_lite::future; use futures_lite::future;
use here_be_dragons::Tile;
use pathfinding::prelude::*; use pathfinding::prelude::*;
use crate::{ use crate::{

View File

@ -9,7 +9,7 @@ use crate::{
commands::RunIfExistsExt, commands::RunIfExistsExt,
core::{Coordinates, CoreConfig, Player, PointLike}, core::{Coordinates, CoreConfig, Player, PointLike},
exploration::ExplorationFocused, exploration::ExplorationFocused,
visibility::{Viewshed, VisibleEntities}, visibility::VisibleEntities,
}; };
#[derive(Component, Clone, Debug, Reflect)] #[derive(Component, Clone, Debug, Reflect)]

View File

@ -8,7 +8,7 @@ use bevy::{
core::{FixedTimestep, FloatOrd}, core::{FixedTimestep, FloatOrd},
prelude::*, prelude::*,
}; };
use bevy_rapier2d::{na, na::UnitComplex}; use bevy_rapier2d::na;
use coord_2d::{Coord, Size}; use coord_2d::{Coord, Size};
use derive_more::{Deref, DerefMut}; use derive_more::{Deref, DerefMut};
use shadowcast::{vision_distance, Context, InputGrid}; use shadowcast::{vision_distance, Context, InputGrid};
@ -19,7 +19,6 @@ use crate::{
core::{Angle, Coordinates, Player, PointLike}, core::{Angle, Coordinates, Player, PointLike},
log::Log, log::Log,
map::{ITileType, Map, MapConfig}, map::{ITileType, Map, MapConfig},
utils::target_and_other,
}; };
#[derive(Component, Clone, Copy, Debug, Default, Reflect)] #[derive(Component, Clone, Copy, Debug, Default, Reflect)]
@ -80,8 +79,8 @@ impl Viewshed {
{ {
for e in entities { for e in entities {
new_visible_entities.insert(*e); new_visible_entities.insert(*e);
return *opacity;
} }
return *opacity;
} }
let tile = map.at(coord.x as usize, coord.y as usize); let tile = map.at(coord.x as usize, coord.y as usize);
if tile.blocks_visibility() { if tile.blocks_visibility() {