use bevy::prelude::{Deref, DerefMut};
#[repr(u32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum Interpretation {
Whole,
Decimal { multiplier: u32 },
}
#[derive(Deref, DerefMut, Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct FastVolume(i64);
impl FastVolume {
pub fn as_whole_i64(self) -> i64 {
self.0
}
pub fn as_interpreted_f64(
self,
interpretation: Interpretation,
) -> f64 {
match interpretation {
Interpretation::Whole => self.0 as f64,
Interpretation::Decimal { multiplier } => self.0 as f64 * multiplier as f64,
}
}
}