rename speed to clock_rate
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
- [BREAKING] Store `HitObject::sound` in `Beatmap::sounds` instead to reduce the struct size
|
- [BREAKING] Store `HitObject::sound` in `Beatmap::sounds` instead to reduce the struct size
|
||||||
- [BREAKING] Removed the mode features `osu`, `fruits`, `taiko`, and `mania`. Now all modes are always supported.
|
- [BREAKING] Removed the mode features `osu`, `fruits`, `taiko`, and `mania`. Now all modes are always supported.
|
||||||
- [BREAKING] Renamed the `rosu_pp::fruits` module to `rosu_pp::catch`. Similarly, all structs `Fruits{Name}` were renamed to `Catch{Name}` and enums over the mode have their `Fruits` variant renamed to `Catch`
|
- [BREAKING] Renamed the `rosu_pp::fruits` module to `rosu_pp::catch`. Similarly, all structs `Fruits{Name}` were renamed to `Catch{Name}` and enums over the mode have their `Fruits` variant renamed to `Catch`
|
||||||
|
- [BREAKING] Renamed `Mods`' method `speed` to `clock_rate`
|
||||||
|
|
||||||
# v0.4.0
|
# v0.4.0
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ impl<'map> CatchGradualDifficultyAttributes<'map> {
|
|||||||
|
|
||||||
Self {
|
Self {
|
||||||
idx: 0,
|
idx: 0,
|
||||||
clock_rate: mods.speed(),
|
clock_rate: mods.clock_rate(),
|
||||||
hit_objects,
|
hit_objects,
|
||||||
movement,
|
movement,
|
||||||
prev,
|
prev,
|
||||||
|
|||||||
+1
-1
@@ -109,7 +109,7 @@ impl<'map> CatchStars<'map> {
|
|||||||
/// Suitable to plot the difficulty of a map over time.
|
/// Suitable to plot the difficulty of a map over time.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn strains(self) -> Strains {
|
pub fn strains(self) -> Strains {
|
||||||
let clock_rate = self.clock_rate.unwrap_or_else(|| self.mods.speed());
|
let clock_rate = self.clock_rate.unwrap_or_else(|| self.mods.clock_rate());
|
||||||
let (movement, _) = calculate_movement(self);
|
let (movement, _) = calculate_movement(self);
|
||||||
|
|
||||||
Strains {
|
Strains {
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ impl<'map> ManiaGradualDifficultyAttributes<'map> {
|
|||||||
other => panic!("can not calculate mania difficulty on a {:?} map", other),
|
other => panic!("can not calculate mania difficulty on a {:?} map", other),
|
||||||
};
|
};
|
||||||
|
|
||||||
let clock_rate = mods.speed();
|
let clock_rate = mods.clock_rate();
|
||||||
let strain = Strain::new(columns);
|
let strain = Strain::new(columns);
|
||||||
let columns = columns as f32;
|
let columns = columns as f32;
|
||||||
let difficulty_objects = ManiaObjectIter::new(&map.hit_objects, columns, clock_rate);
|
let difficulty_objects = ManiaObjectIter::new(&map.hit_objects, columns, clock_rate);
|
||||||
|
|||||||
+2
-2
@@ -98,7 +98,7 @@ impl<'map> ManiaStars<'map> {
|
|||||||
/// Suitable to plot the difficulty of a map over time.
|
/// Suitable to plot the difficulty of a map over time.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn strains(self) -> Strains {
|
pub fn strains(self) -> Strains {
|
||||||
let clock_rate = self.clock_rate.unwrap_or_else(|| self.mods.speed());
|
let clock_rate = self.clock_rate.unwrap_or_else(|| self.mods.clock_rate());
|
||||||
let strain = calculate_strain(self);
|
let strain = calculate_strain(self);
|
||||||
|
|
||||||
Strains {
|
Strains {
|
||||||
@@ -140,7 +140,7 @@ fn calculate_strain(params: ManiaStars<'_>) -> Strain {
|
|||||||
other => panic!("can not calculate mania difficulty on a {:?} map", other),
|
other => panic!("can not calculate mania difficulty on a {:?} map", other),
|
||||||
};
|
};
|
||||||
|
|
||||||
let clock_rate = clock_rate.unwrap_or_else(|| mods.speed());
|
let clock_rate = clock_rate.unwrap_or_else(|| mods.clock_rate());
|
||||||
let mut strain = Strain::new(columns);
|
let mut strain = Strain::new(columns);
|
||||||
let columns = columns as f32;
|
let columns = columns as f32;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -141,7 +141,7 @@ impl<'map> ManiaPP<'map> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let mut od = 34.0 + 3.0 * (10.0 - self.map.od as f64).max(0.0).min(10.0);
|
let mut od = 34.0 + 3.0 * (10.0 - self.map.od as f64).max(0.0).min(10.0);
|
||||||
let clock_rate = self.mods.speed();
|
let clock_rate = self.mods.clock_rate();
|
||||||
|
|
||||||
let mut multiplier = 0.8;
|
let mut multiplier = 0.8;
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -26,7 +26,7 @@ pub trait Mods: Copy {
|
|||||||
/// If object time's or positions are affected by the mods.
|
/// If object time's or positions are affected by the mods.
|
||||||
fn change_map(self) -> bool;
|
fn change_map(self) -> bool;
|
||||||
/// The clock rate with the mods.
|
/// The clock rate with the mods.
|
||||||
fn speed(self) -> f64;
|
fn clock_rate(self) -> f64;
|
||||||
/// Multiplier for beatmap attributes with respect to the mods.
|
/// Multiplier for beatmap attributes with respect to the mods.
|
||||||
fn od_ar_hp_multiplier(self) -> f64;
|
fn od_ar_hp_multiplier(self) -> f64;
|
||||||
fn nf(self) -> bool;
|
fn nf(self) -> bool;
|
||||||
@@ -53,7 +53,7 @@ impl Mods for u32 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn speed(self) -> f64 {
|
fn clock_rate(self) -> f64 {
|
||||||
if self & Self::DT > 0 {
|
if self & Self::DT > 0 {
|
||||||
1.5
|
1.5
|
||||||
} else if self & Self::HT > 0 {
|
} else if self & Self::HT > 0 {
|
||||||
|
|||||||
+2
-2
@@ -163,7 +163,7 @@ impl<'map> OsuStars<'map> {
|
|||||||
/// Suitable to plot the difficulty of a map over time.
|
/// Suitable to plot the difficulty of a map over time.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn strains(self) -> Strains {
|
pub fn strains(self) -> Strains {
|
||||||
let clock_rate = self.clock_rate.unwrap_or_else(|| self.mods.speed());
|
let clock_rate = self.clock_rate.unwrap_or_else(|| self.mods.clock_rate());
|
||||||
let (mut skills, _) = calculate_skills(self);
|
let (mut skills, _) = calculate_skills(self);
|
||||||
|
|
||||||
let mut aim = mem::take(&mut skills.aim().strain_peaks);
|
let mut aim = mem::take(&mut skills.aim().strain_peaks);
|
||||||
@@ -236,7 +236,7 @@ fn calculate_skills(params: OsuStars<'_>) -> (Skills, OsuDifficultyAttributes) {
|
|||||||
} = params;
|
} = params;
|
||||||
|
|
||||||
let take = passed_objects.unwrap_or_else(|| map.hit_objects.len());
|
let take = passed_objects.unwrap_or_else(|| map.hit_objects.len());
|
||||||
let clock_rate = clock_rate.unwrap_or_else(|| mods.speed());
|
let clock_rate = clock_rate.unwrap_or_else(|| mods.clock_rate());
|
||||||
|
|
||||||
let map_attributes = map.attributes().mods(mods);
|
let map_attributes = map.attributes().mods(mods);
|
||||||
let hit_window = difficulty_range_od(map_attributes.od) / clock_rate;
|
let hit_window = difficulty_range_od(map_attributes.od) / clock_rate;
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ impl BeatmapAttributes {
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
let clock_rate = mods.speed();
|
let clock_rate = mods.clock_rate();
|
||||||
let multiplier = mods.od_ar_hp_multiplier();
|
let multiplier = mods.od_ar_hp_multiplier();
|
||||||
|
|
||||||
// AR
|
// AR
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ impl<'map> TaikoGradualDifficultyAttributes<'map> {
|
|||||||
let cheese = map.find_cheese();
|
let cheese = map.find_cheese();
|
||||||
|
|
||||||
let skills = Skills::new();
|
let skills = Skills::new();
|
||||||
let clock_rate = mods.speed();
|
let clock_rate = mods.clock_rate();
|
||||||
let difficulty_objects = GradualTaikoObjectIter::new(map, clock_rate);
|
let difficulty_objects = GradualTaikoObjectIter::new(map, clock_rate);
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
|
|||||||
+2
-2
@@ -139,7 +139,7 @@ impl<'map> TaikoStars<'map> {
|
|||||||
/// Suitable to plot the difficulty of a map over time.
|
/// Suitable to plot the difficulty of a map over time.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn strains(self) -> Strains {
|
pub fn strains(self) -> Strains {
|
||||||
let clock_rate = self.clock_rate.unwrap_or_else(|| self.mods.speed());
|
let clock_rate = self.clock_rate.unwrap_or_else(|| self.mods.clock_rate());
|
||||||
let (skills, _) = calculate_skills(self);
|
let (skills, _) = calculate_skills(self);
|
||||||
|
|
||||||
let strains = skills
|
let strains = skills
|
||||||
@@ -170,7 +170,7 @@ fn calculate_skills(params: TaikoStars<'_>) -> (Skills, usize) {
|
|||||||
} = params;
|
} = params;
|
||||||
|
|
||||||
let take = passed_objects.unwrap_or_else(|| map.hit_objects.len());
|
let take = passed_objects.unwrap_or_else(|| map.hit_objects.len());
|
||||||
let clock_rate = clock_rate.unwrap_or_else(|| mods.speed());
|
let clock_rate = clock_rate.unwrap_or_else(|| mods.clock_rate());
|
||||||
|
|
||||||
// True if the object at that index is stamina cheese
|
// True if the object at that index is stamina cheese
|
||||||
let cheese = map.find_cheese();
|
let cheese = map.find_cheese();
|
||||||
|
|||||||
+1
-1
@@ -285,7 +285,7 @@ impl<'map> TaikoPPInner<'map> {
|
|||||||
od *= 0.5;
|
od *= 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
let hit_window = difficulty_range_od(od).floor() / self.mods.speed();
|
let hit_window = difficulty_range_od(od).floor() / self.mods.clock_rate();
|
||||||
let max_combo = self.attributes.max_combo;
|
let max_combo = self.attributes.max_combo;
|
||||||
|
|
||||||
(150.0 / hit_window).powf(1.1)
|
(150.0 / hit_window).powf(1.1)
|
||||||
|
|||||||
Reference in New Issue
Block a user