renamed 'attributes' field to 'difficulty' for performance attributes
This commit is contained in:
+3
-3
@@ -152,7 +152,7 @@ pub struct ManiaDifficultyAttributes {
|
||||
#[derive(Copy, Clone, Debug, Default)]
|
||||
pub struct ManiaPerformanceAttributes {
|
||||
/// The difficulty attributes that were used for the performance calculation
|
||||
pub attributes: ManiaDifficultyAttributes,
|
||||
pub difficulty: ManiaDifficultyAttributes,
|
||||
/// The final performance points.
|
||||
pub pp: f64,
|
||||
/// The accuracy portion of the final pp.
|
||||
@@ -165,7 +165,7 @@ impl ManiaPerformanceAttributes {
|
||||
/// Return the star value.
|
||||
#[inline]
|
||||
pub fn stars(&self) -> f64 {
|
||||
self.attributes.stars
|
||||
self.difficulty.stars
|
||||
}
|
||||
|
||||
/// Return the performance point value.
|
||||
@@ -177,6 +177,6 @@ impl ManiaPerformanceAttributes {
|
||||
|
||||
impl From<ManiaPerformanceAttributes> for ManiaDifficultyAttributes {
|
||||
fn from(attributes: ManiaPerformanceAttributes) -> Self {
|
||||
attributes.attributes
|
||||
attributes.difficulty
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -133,7 +133,7 @@ impl<'map> ManiaPP<'map> {
|
||||
let pp = (strain_value.powf(1.1) + acc_value.powf(1.1)).powf(1.0 / 1.1) * multiplier;
|
||||
|
||||
ManiaPerformanceAttributes {
|
||||
attributes: ManiaDifficultyAttributes { stars },
|
||||
difficulty: ManiaDifficultyAttributes { stars },
|
||||
pp_acc: acc_value,
|
||||
pp_strain: strain_value,
|
||||
pp,
|
||||
@@ -193,7 +193,7 @@ impl ManiaAttributeProvider for ManiaDifficultyAttributes {
|
||||
impl ManiaAttributeProvider for ManiaPerformanceAttributes {
|
||||
#[inline]
|
||||
fn attributes(self) -> Option<f64> {
|
||||
Some(self.attributes.stars)
|
||||
Some(self.difficulty.stars)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ impl ManiaAttributeProvider for PerformanceAttributes {
|
||||
fn attributes(self) -> Option<f64> {
|
||||
#[allow(irrefutable_let_patterns)]
|
||||
if let Self::Mania(attributes) = self {
|
||||
Some(attributes.attributes.stars)
|
||||
Some(attributes.difficulty.stars)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user