clamp clock rate
This commit is contained in:
@@ -33,13 +33,13 @@ impl ModeDifficulty {
|
||||
}
|
||||
}
|
||||
|
||||
/// Adjust the clock rate used in the calculation.
|
||||
/// Adjust the clock rate used in the calculation between 0.01 and 100.0.
|
||||
///
|
||||
/// If none is specified, it will take the clock rate based on the mods
|
||||
/// i.e. 1.5 for DT, 0.75 for HT and 1.0 otherwise.
|
||||
pub const fn clock_rate(self, clock_rate: f64) -> Self {
|
||||
pub fn clock_rate(self, clock_rate: f64) -> Self {
|
||||
Self {
|
||||
clock_rate: Some(clock_rate),
|
||||
clock_rate: Some(clock_rate.clamp(0.01, 100.0)),
|
||||
..self
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ impl<'map> CatchPerformance<'map> {
|
||||
/// Adjust the clock rate used in the calculation.
|
||||
/// If none is specified, it will take the clock rate based on the mods
|
||||
/// i.e. 1.5 for DT, 0.75 for HT and 1.0 otherwise.
|
||||
pub const fn clock_rate(mut self, clock_rate: f64) -> Self {
|
||||
pub fn clock_rate(mut self, clock_rate: f64) -> Self {
|
||||
self.difficulty = self.difficulty.clock_rate(clock_rate);
|
||||
|
||||
self
|
||||
|
||||
@@ -182,5 +182,3 @@ pub mod mania;
|
||||
pub mod model;
|
||||
|
||||
mod util;
|
||||
|
||||
// TODO: fix very low custom clock rates
|
||||
|
||||
@@ -74,7 +74,7 @@ impl<'map> ManiaPerformance<'map> {
|
||||
/// Adjust the clock rate used in the calculation.
|
||||
/// If none is specified, it will take the clock rate based on the mods
|
||||
/// i.e. 1.5 for DT, 0.75 for HT and 1.0 otherwise.
|
||||
pub const fn clock_rate(mut self, clock_rate: f64) -> Self {
|
||||
pub fn clock_rate(mut self, clock_rate: f64) -> Self {
|
||||
self.difficulty = self.difficulty.clock_rate(clock_rate);
|
||||
|
||||
self
|
||||
|
||||
@@ -170,7 +170,7 @@ impl<'map> OsuPerformance<'map> {
|
||||
/// Adjust the clock rate used in the calculation.
|
||||
/// If none is specified, it will take the clock rate based on the mods
|
||||
/// i.e. 1.5 for DT, 0.75 for HT and 1.0 otherwise.
|
||||
pub const fn clock_rate(mut self, clock_rate: f64) -> Self {
|
||||
pub fn clock_rate(mut self, clock_rate: f64) -> Self {
|
||||
self.difficulty = self.difficulty.clock_rate(clock_rate);
|
||||
|
||||
self
|
||||
|
||||
@@ -117,7 +117,7 @@ impl<'map> TaikoPerformance<'map> {
|
||||
/// Adjust the clock rate used in the calculation.
|
||||
/// If none is specified, it will take the clock rate based on the mods
|
||||
/// i.e. 1.5 for DT, 0.75 for HT and 1.0 otherwise.
|
||||
pub const fn clock_rate(mut self, clock_rate: f64) -> Self {
|
||||
pub fn clock_rate(mut self, clock_rate: f64) -> Self {
|
||||
self.difficulty = self.difficulty.clock_rate(clock_rate);
|
||||
|
||||
self
|
||||
|
||||
Reference in New Issue
Block a user