use crate::mania::performance::ManiaPerformance;
#[derive(Clone, Debug, Default, PartialEq)]
pub struct ManiaDifficultyAttributes {
pub stars: f64,
pub n_objects: u32,
pub n_hold_notes: u32,
pub max_combo: u32,
pub is_convert: bool,
}
impl ManiaDifficultyAttributes {
pub const fn max_combo(&self) -> u32 {
self.max_combo
}
pub const fn n_objects(&self) -> u32 {
self.n_objects
}
pub const fn is_convert(&self) -> bool {
self.is_convert
}
pub fn performance<'a>(self) -> ManiaPerformance<'a> {
self.into()
}
}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct ManiaPerformanceAttributes {
pub difficulty: ManiaDifficultyAttributes,
pub pp: f64,
pub pp_difficulty: f64,
}
impl ManiaPerformanceAttributes {
pub const fn stars(&self) -> f64 {
self.difficulty.stars
}
pub const fn pp(&self) -> f64 {
self.pp
}
pub const fn max_combo(&self) -> u32 {
self.difficulty.max_combo
}
pub const fn n_objects(&self) -> u32 {
self.difficulty.n_objects
}
pub const fn is_convert(&self) -> bool {
self.difficulty.is_convert
}
pub fn performance<'a>(self) -> ManiaPerformance<'a> {
self.difficulty.into()
}
}
impl From<ManiaPerformanceAttributes> for ManiaDifficultyAttributes {
fn from(attributes: ManiaPerformanceAttributes) -> Self {
attributes.difficulty
}
}