refactor!: add is_convert to taiko&mania diff attrs

This commit is contained in:
MaxOhn
2023-12-29 11:04:21 +01:00
parent 9b6d4c0c9e
commit 90958f9979
3 changed files with 32 additions and 0 deletions
+15
View File
@@ -139,6 +139,7 @@ impl<'map> ManiaStars<'map> {
hit_window,
max_combo,
n_objects,
is_convert,
}
}
@@ -239,6 +240,8 @@ pub struct ManiaDifficultyAttributes {
pub n_objects: usize,
/// The maximum achievable combo.
pub max_combo: usize,
/// Whether the [`Beatmap`] was a convert i.e. an osu!standard map.
pub is_convert: bool,
}
impl ManiaDifficultyAttributes {
@@ -253,6 +256,12 @@ impl ManiaDifficultyAttributes {
pub fn n_objects(&self) -> usize {
self.n_objects
}
/// Whether the [`Beatmap`] was a convert i.e. an osu!standard map.
#[inline]
pub fn is_convert(&self) -> bool {
self.is_convert
}
}
/// The result of a performance calculation on an osu!mania map.
@@ -290,6 +299,12 @@ impl ManiaPerformanceAttributes {
pub fn n_objects(&self) -> usize {
self.difficulty.n_objects
}
/// Whether the [`Beatmap`] was a convert i.e. an osu!standard map.
#[inline]
pub fn is_convert(&self) -> bool {
self.difficulty.is_convert
}
}
impl From<ManiaPerformanceAttributes> for ManiaDifficultyAttributes {
+15
View File
@@ -170,6 +170,7 @@ impl<'map> TaikoStars<'map> {
hit_window,
stars: star_rating,
max_combo,
is_convert,
}
}
@@ -309,6 +310,8 @@ pub struct TaikoDifficultyAttributes {
pub stars: f64,
/// The maximum combo.
pub max_combo: usize,
/// Whether the [`Beatmap`] was a convert i.e. an osu!standard map.
pub is_convert: bool,
}
impl TaikoDifficultyAttributes {
@@ -317,6 +320,12 @@ impl TaikoDifficultyAttributes {
pub fn max_combo(&self) -> usize {
self.max_combo
}
/// Whether the [`Beatmap`] was a convert i.e. an osu!standard map.
#[inline]
pub fn is_convert(&self) -> bool {
self.is_convert
}
}
/// The result of a performance calculation on an osu!taiko map.
@@ -352,6 +361,12 @@ impl TaikoPerformanceAttributes {
pub fn max_combo(&self) -> usize {
self.difficulty.max_combo
}
/// Whether the [`Beatmap`] was a convert i.e. an osu!standard map.
#[inline]
pub fn is_convert(&self) -> bool {
self.difficulty.is_convert
}
}
impl From<TaikoPerformanceAttributes> for TaikoDifficultyAttributes {
+2
View File
@@ -52,6 +52,7 @@ impl_mode! {
hit_window: 35.0,
stars: 2.9778030386845606,
max_combo: 289,
is_convert: false,
};
Catch: 2118524, CatchDifficultyAttributes {
stars: 3.2502669316166624,
@@ -65,5 +66,6 @@ impl_mode! {
hit_window: 40.0,
max_combo: 956,
n_objects: 594,
is_convert: false,
};
}