remove async pp calculation & reset to v0.1.1

This commit is contained in:
MaxOhn
2021-02-23 19:45:10 +01:00
parent 739c512203
commit 584e1c5714
6 changed files with 1 additions and 35 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "rosu-pp" name = "rosu-pp"
version = "0.1.2" version = "0.1.1"
authors = ["MaxOhn <ohn.m@hotmail.de>"] authors = ["MaxOhn <ohn.m@hotmail.de>"]
edition = "2018" edition = "2018"
license = "MIT" license = "MIT"
-5
View File
@@ -315,11 +315,6 @@ impl<'m> FruitsPP<'m> {
} }
} }
#[inline]
pub async fn calculate_async(self) -> PpResult {
self.calculate()
}
#[inline] #[inline]
fn combo_hits(&self) -> usize { fn combo_hits(&self) -> usize {
self.n_fruits.unwrap_or(0) + self.n_droplets.unwrap_or(0) + self.n_misses self.n_fruits.unwrap_or(0) + self.n_droplets.unwrap_or(0) + self.n_misses
-5
View File
@@ -136,11 +136,6 @@ impl<'m> ManiaPP<'m> {
} }
} }
#[inline]
pub async fn calculate_async(self) -> PpResult {
self.calculate()
}
fn compute_strain(&self, score: f32, stars: f32) -> f32 { fn compute_strain(&self, score: f32, stars: f32) -> f32 {
let mut strain_value = (5.0 * (stars / 0.2).max(1.0) - 4.0).powf(2.2) / 135.0; let mut strain_value = (5.0 * (stars / 0.2).max(1.0) - 4.0).powf(2.2) / 135.0;
-5
View File
@@ -261,11 +261,6 @@ impl<'m> OsuPP<'m> {
unreachable!() unreachable!()
} }
#[inline]
pub async fn calculate_async(self) -> PpResult {
self.calculate()
}
/// Returns an object which contains the pp and [`DifficultyAttributes`](crate::osu::DifficultyAttributes) /// Returns an object which contains the pp and [`DifficultyAttributes`](crate::osu::DifficultyAttributes)
/// containing stars and other attributes. /// containing stars and other attributes.
/// ///
-14
View File
@@ -55,20 +55,6 @@ impl<'m> AnyPP<'m> {
} }
} }
#[inline]
pub async fn calculate_async(self) -> PpResult {
match self {
#[cfg(feature = "fruits")]
Self::Fruits(f) => f.calculate_async().await,
#[cfg(feature = "mania")]
Self::Mania(m) => m.calculate_async().await,
#[cfg(feature = "osu")]
Self::Osu(o) => o.calculate_async().await,
#[cfg(feature = "taiko")]
Self::Taiko(t) => t.calculate_async().await,
}
}
/// [`AttributeProvider`] is implemented by [`StarResult`](crate::StarResult) /// [`AttributeProvider`] is implemented by [`StarResult`](crate::StarResult)
/// and [`PpResult`](crate::PpResult) meaning you can give the result of a \ /// and [`PpResult`](crate::PpResult) meaning you can give the result of a \
/// star calculation or the result of a pp calculation. /// star calculation or the result of a pp calculation.
-5
View File
@@ -181,11 +181,6 @@ impl<'m> TaikoPP<'m> {
} }
} }
#[inline]
pub async fn calculate_async(self) -> PpResult {
self.calculate()
}
fn compute_strain_value(&self, stars: f32) -> f32 { fn compute_strain_value(&self, stars: f32) -> f32 {
let exp_base = 5.0 * (stars / 0.0075).max(1.0) - 4.0; let exp_base = 5.0 * (stars / 0.0075).max(1.0) - 4.0;
let mut strain = exp_base * exp_base / 100_000.0; let mut strain = exp_base * exp_base / 100_000.0;