Revert "clippy fixes"

This reverts commit f6e94cfd32.
This commit is contained in:
2025-06-29 10:54:59 +02:00
parent f6e94cfd32
commit 5d4c7630ef
65 changed files with 85 additions and 495 deletions

View File

@@ -1,39 +0,0 @@
use crate::heads::HeadState;
use bevy::prelude::*;
#[derive(Clone, Copy, Debug, PartialEq, Reflect, Default)]
pub struct UiHeadState {
pub head: usize,
pub health: f32,
pub ammo: f32,
pub reloading: Option<f32>,
}
impl UiHeadState {
pub fn damage(&self) -> f32 {
1. - self.health
}
pub fn ammo_used(&self) -> f32 {
1. - self.ammo
}
pub fn reloading(&self) -> Option<f32> {
self.reloading
}
pub(crate) fn new(value: HeadState, time: f32) -> Self {
let reloading = if value.has_ammo() {
None
} else {
Some((time - value.last_use) / value.reload_duration)
};
Self {
head: value.head,
ammo: value.ammo as f32 / value.ammo_max as f32,
health: value.health as f32 / value.health_max as f32,
reloading,
}
}
}