restructured StarResult to unify modes

This commit is contained in:
MaxOhn
2021-01-19 20:59:44 +01:00
parent bd6130d79c
commit f12a190d4f
11 changed files with 98 additions and 80 deletions
+2 -4
View File
@@ -31,9 +31,7 @@ pub fn stars(map: &Beatmap, mods: impl Mods, passed_objects: Option<usize>) -> S
let take = passed_objects.unwrap_or_else(|| map.hit_objects.len());
if take < 2 {
return StarResult::Fruits {
attributes: DifficultyAttributes::default(),
};
return StarResult::Fruits(DifficultyAttributes::default());
}
let attributes = map.attributes().mods(mods);
@@ -275,7 +273,7 @@ pub fn stars(map: &Beatmap, mods: impl Mods, passed_objects: Option<usize>) -> S
max_combo: fruits + droplets,
};
StarResult::Fruits { attributes }
StarResult::Fruits(attributes)
}
/// Essentially the same as the `stars` function but instead of
+2 -2
View File
@@ -13,7 +13,7 @@ impl FruitsAttributeProvider for DifficultyAttributes {
impl FruitsAttributeProvider for StarResult {
fn attributes(self) -> Option<DifficultyAttributes> {
if let Self::Fruits { attributes } = self {
if let Self::Fruits(attributes) = self {
Some(attributes)
} else {
None
@@ -286,7 +286,7 @@ impl<'m> FruitsPP<'m> {
PpResult {
pp,
attributes: StarResult::Fruits { attributes },
attributes: StarResult::Fruits(attributes),
}
}