added max_combo method for all PerformanceAttributes structs
This commit is contained in:
@@ -457,6 +457,12 @@ impl FruitsPerformanceAttributes {
|
||||
pub fn pp(&self) -> f64 {
|
||||
self.pp
|
||||
}
|
||||
|
||||
/// Return the maximum combo of the map.
|
||||
#[inline]
|
||||
pub fn max_combo(&self) -> usize {
|
||||
self.attributes.max_combo
|
||||
}
|
||||
}
|
||||
|
||||
impl From<FruitsPerformanceAttributes> for FruitsDifficultyAttributes {
|
||||
|
||||
+34
-3
@@ -319,7 +319,7 @@ impl DifficultyAttributes {
|
||||
}
|
||||
}
|
||||
|
||||
/// The max combo of the map.
|
||||
/// The maximum combo of the map.
|
||||
///
|
||||
/// This will only be `None` for attributes of osu!mania maps.
|
||||
#[inline]
|
||||
@@ -336,9 +336,9 @@ impl DifficultyAttributes {
|
||||
}
|
||||
}
|
||||
|
||||
/// The max combo of the map.
|
||||
#[inline]
|
||||
#[cfg(not(feature = "mania"))]
|
||||
#[inline]
|
||||
/// The maximum combo of the map.
|
||||
pub fn max_combo(&self) -> usize {
|
||||
match self {
|
||||
#[cfg(feature = "fruits")]
|
||||
@@ -441,6 +441,37 @@ impl PerformanceAttributes {
|
||||
Self::Taiko(attributes) => DifficultyAttributes::Taiko(attributes.attributes),
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "mania")]
|
||||
#[inline]
|
||||
/// The maximum combo of the map.
|
||||
///
|
||||
/// This will only be `None` for attributes of osu!mania maps.
|
||||
pub fn max_combo(&self) -> Option<usize> {
|
||||
match self {
|
||||
#[cfg(feature = "fruits")]
|
||||
Self::Fruits(f) => Some(f.attributes.max_combo),
|
||||
Self::Mania(_) => None,
|
||||
#[cfg(feature = "osu")]
|
||||
Self::Osu(o) => Some(o.attributes.max_combo),
|
||||
#[cfg(feature = "taiko")]
|
||||
Self::Taiko(t) => Some(t.attributes.max_combo),
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "mania"))]
|
||||
#[inline]
|
||||
/// The maximum combo of the map.
|
||||
pub fn max_combo(&self) -> usize {
|
||||
match self {
|
||||
#[cfg(feature = "fruits")]
|
||||
Self::Fruits(f) => f.attributes.max_combo,
|
||||
#[cfg(feature = "osu")]
|
||||
Self::Osu(o) => o.attributes.max_combo,
|
||||
#[cfg(feature = "taiko")]
|
||||
Self::Taiko(t) => t.attributes.max_combo,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<PerformanceAttributes> for DifficultyAttributes {
|
||||
|
||||
@@ -502,6 +502,12 @@ impl OsuPerformanceAttributes {
|
||||
pub fn pp(&self) -> f64 {
|
||||
self.pp
|
||||
}
|
||||
|
||||
/// Return the maximum combo of the map.
|
||||
#[inline]
|
||||
pub fn max_combo(&self) -> usize {
|
||||
self.attributes.max_combo
|
||||
}
|
||||
}
|
||||
|
||||
impl From<OsuPerformanceAttributes> for OsuDifficultyAttributes {
|
||||
|
||||
@@ -259,6 +259,12 @@ impl TaikoPerformanceAttributes {
|
||||
pub fn pp(&self) -> f64 {
|
||||
self.pp
|
||||
}
|
||||
|
||||
/// Return the maximum combo of the map.
|
||||
#[inline]
|
||||
pub fn max_combo(&self) -> usize {
|
||||
self.attributes.max_combo
|
||||
}
|
||||
}
|
||||
|
||||
impl From<TaikoPerformanceAttributes> for TaikoDifficultyAttributes {
|
||||
|
||||
Reference in New Issue
Block a user