remove clock rate from strains section length

This commit is contained in:
MaxOhn
2022-10-26 22:17:12 +02:00
parent 533ff8c960
commit 007410192b
5 changed files with 8 additions and 9 deletions
+3
View File
@@ -3,6 +3,9 @@
- __Adjustments:__
- When passing an osu!std map to `TaikoPP` or `ManiaPP`, it now automatically converts the map internally. For osu!catch it was already happening trivially.
- __Fixes:__
- The fields `section_len` for all strain structs no longer depends on the clock rate.
# v0.9.0 (2022-10-24)
Big changes including the most recent [osu!](https://osu.ppy.sh/home/news/2022-09-30-changes-to-osu-sr-and-pp), [taiko](https://osu.ppy.sh/home/news/2022-09-28-changes-to-osu-taiko-sr-and-pp), and [mania](https://osu.ppy.sh/home/news/2022-10-09-changes-to-osu-mania-sr-and-pp) updates, aswell as various breaking changes.
+1 -2
View File
@@ -107,11 +107,10 @@ impl<'map> CatchStars<'map> {
/// Suitable to plot the difficulty of a map over time.
#[inline]
pub fn strains(self) -> CatchStrains {
let clock_rate = self.clock_rate.unwrap_or_else(|| self.mods.clock_rate());
let (movement, _) = calculate_movement(self);
CatchStrains {
section_len: SECTION_LENGTH * clock_rate,
section_len: SECTION_LENGTH,
movement: movement.strain_peaks,
}
}
+1 -2
View File
@@ -134,11 +134,10 @@ impl<'map> ManiaStars<'map> {
/// Suitable to plot the difficulty of a map over time.
#[inline]
pub fn strains(self) -> ManiaStrains {
let clock_rate = self.clock_rate.unwrap_or_else(|| self.mods.clock_rate());
let ManiaResult { strain, .. } = calculate_result(self);
ManiaStrains {
section_len: SECTION_LEN * clock_rate,
section_len: SECTION_LEN,
strains: strain.strain_peaks,
}
}
+2 -3
View File
@@ -187,7 +187,6 @@ impl<'map> OsuStars<'map> {
/// Suitable to plot the difficulty of a map over time.
#[inline]
pub fn strains(self) -> OsuStrains {
let clock_rate = self.clock_rate.unwrap_or_else(|| self.mods.clock_rate());
let (skills, _) = calculate_skills(self);
let Skills {
@@ -198,7 +197,7 @@ impl<'map> OsuStars<'map> {
} = skills;
OsuStrains {
section_len: SECTION_LEN * clock_rate,
section_len: SECTION_LEN,
aim: aim.strain_peaks,
aim_no_sliders: aim_no_sliders.strain_peaks,
speed: speed.strain_peaks,
@@ -212,7 +211,7 @@ impl<'map> OsuStars<'map> {
#[derive(Clone, Debug)]
pub struct OsuStrains {
/// Time in ms inbetween two strains.
pub section_len: f64,
pub section_len: f64, // TODO: remove field, make it a method
/// Strain peaks of the aim skill.
pub aim: Vec<f64>,
/// Strain peaks of the aim skill without sliders.
+1 -2
View File
@@ -165,7 +165,6 @@ impl<'map> TaikoStars<'map> {
/// Suitable to plot the difficulty of a map over time.
#[inline]
pub fn strains(self) -> TaikoStrains {
let clock_rate = self.clock_rate.unwrap_or_else(|| self.mods.clock_rate());
let (peaks, _) = calculate_skills(self);
let PeaksRaw {
@@ -175,7 +174,7 @@ impl<'map> TaikoStars<'map> {
} = peaks.into_raw();
TaikoStrains {
section_len: SECTION_LEN as f64 * clock_rate,
section_len: SECTION_LEN as f64,
color: colour,
rhythm,
stamina,