refactor!: add n_objects to mania diff attrs

This commit is contained in:
MaxOhn
2023-12-29 09:00:28 +01:00
parent 841eb914b0
commit 1213525246
3 changed files with 28 additions and 0 deletions
+11
View File
@@ -589,6 +589,12 @@ impl OsuDifficultyAttributes {
pub fn max_combo(&self) -> usize {
self.max_combo
}
/// Return the amount of hitobjects.
#[inline]
pub fn n_objects(&self) -> usize {
self.n_circles + self.n_sliders + self.n_spinners
}
}
/// The result of a performance calculation on an osu!standard map.
@@ -628,6 +634,11 @@ impl OsuPerformanceAttributes {
pub fn max_combo(&self) -> usize {
self.difficulty.max_combo
}
/// Return the amount of hitobjects.
#[inline]
pub fn n_objects(&self) -> usize {
self.difficulty.n_objects()
}
}
impl From<OsuPerformanceAttributes> for OsuDifficultyAttributes {