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_tts::Tts;
use derive_more::{Deref, DerefMut};
use here_be_dragons::Tile;
use crate::{
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::type_complexity)]

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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