renamed 'attributes' field to 'difficulty' for performance attributes

This commit is contained in:
MaxOhn
2021-11-21 04:15:41 +01:00
parent bdc2927963
commit df022ee428
11 changed files with 43 additions and 42 deletions
+4 -4
View File
@@ -238,7 +238,7 @@ pub struct TaikoDifficultyAttributes {
#[derive(Clone, Debug, Default)]
pub struct TaikoPerformanceAttributes {
/// The difficulty attributes that were used for the performance calculation
pub attributes: TaikoDifficultyAttributes,
pub difficulty: TaikoDifficultyAttributes,
/// The final performance points.
pub pp: f64,
/// The accuracy portion of the final pp.
@@ -251,7 +251,7 @@ impl TaikoPerformanceAttributes {
/// Return the star value.
#[inline]
pub fn stars(&self) -> f64 {
self.attributes.stars
self.difficulty.stars
}
/// Return the performance point value.
@@ -263,12 +263,12 @@ impl TaikoPerformanceAttributes {
/// Return the maximum combo of the map.
#[inline]
pub fn max_combo(&self) -> usize {
self.attributes.max_combo
self.difficulty.max_combo
}
}
impl From<TaikoPerformanceAttributes> for TaikoDifficultyAttributes {
fn from(attributes: TaikoPerformanceAttributes) -> Self {
attributes.attributes
attributes.difficulty
}
}
+3 -3
View File
@@ -199,7 +199,7 @@ impl<'map> TaikoPPInner<'map> {
let pp = (strain_value.powf(1.1) + acc_value.powf(1.1)).powf(1.0 / 1.1) * multiplier;
TaikoPerformanceAttributes {
attributes: self.attributes,
difficulty: self.attributes,
pp,
pp_acc: acc_value,
pp_strain: strain_value,
@@ -273,7 +273,7 @@ impl TaikoAttributeProvider for TaikoDifficultyAttributes {
impl TaikoAttributeProvider for TaikoPerformanceAttributes {
#[inline]
fn attributes(self) -> Option<TaikoDifficultyAttributes> {
Some(self.attributes)
Some(self.difficulty)
}
}
@@ -294,7 +294,7 @@ impl TaikoAttributeProvider for PerformanceAttributes {
fn attributes(self) -> Option<TaikoDifficultyAttributes> {
#[allow(irrefutable_let_patterns)]
if let Self::Taiko(attributes) = self {
Some(attributes.attributes)
Some(attributes.difficulty)
} else {
None
}