feat: add last method to gradual perf calc

This commit is contained in:
MaxOhn
2023-11-08 21:26:39 +01:00
parent 2be5bdc365
commit 719894526d
4 changed files with 20 additions and 0 deletions
+5
View File
@@ -122,6 +122,11 @@ impl<'map> CatchGradualPerformanceAttributes<'map> {
self.nth(state, 0)
}
/// Process all remaining hit objects and calculate the final performance attributes.
pub fn last(&mut self, state: CatchScoreState) -> Option<CatchPerformanceAttributes> {
self.nth(state, usize::MAX)
}
/// Process everything up the the next `n`th hit object and calculate the performance
/// attributes for the resulting score state.
///
+5
View File
@@ -100,6 +100,11 @@ impl<'map> ManiaGradualPerformanceAttributes<'map> {
self.nth(state, 0)
}
/// Process all remaining hit objects and calculate the final performance attributes.
pub fn last(&mut self, state: ManiaScoreState) -> Option<ManiaPerformanceAttributes> {
self.nth(state, usize::MAX)
}
/// Process everything up the the next `n`th hit object and calculate the performance
/// attributes for the resulting score state.
///
+5
View File
@@ -114,6 +114,11 @@ impl<'map> OsuGradualPerformanceAttributes<'map> {
self.nth(state, 0)
}
/// Process all remaining hit objects and calculate the final performance attributes.
pub fn last(&mut self, state: OsuScoreState) -> Option<OsuPerformanceAttributes> {
self.nth(state, usize::MAX)
}
/// Process everything up the the next `n`th hit object and calculate the performance
/// attributes for the resulting score state.
///
+5
View File
@@ -112,6 +112,11 @@ impl<'map> TaikoGradualPerformanceAttributes<'map> {
self.nth(state, 0)
}
/// Process all remaining hit objects and calculate the final performance attributes.
pub fn last(&mut self, state: TaikoScoreState) -> Option<TaikoPerformanceAttributes> {
self.nth(state, usize::MAX)
}
/// Process everything up the the next `n`th hit object and calculate the performance
/// attributes for the resulting score state.
///