added AttributeProvider impl to mode performance attrs
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
- osu: Fix panic on maps with 0 objects
|
- osu: Fix panic on maps with 0 objects
|
||||||
- [BREAKING] Store `HitObject::sound` in `Beatmap::sounds` instead to reduce the struct size
|
- [BREAKING] Store `HitObject::sound` in `Beatmap::sounds` instead to reduce the struct size
|
||||||
|
- Added `AttributeProvider` impl for `{Mode}PerformanceAttributes`
|
||||||
|
|
||||||
# v0.4.0
|
# v0.4.0
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
use crate::{Beatmap, DifficultyAttributes, GameMode, PerformanceAttributes, ScoreState};
|
use crate::{Beatmap, DifficultyAttributes, GameMode, PerformanceAttributes, ScoreState};
|
||||||
|
|
||||||
#[cfg(feature = "fruits")]
|
#[cfg(feature = "fruits")]
|
||||||
use crate::fruits::{FruitsDifficultyAttributes, FruitsPP};
|
use crate::fruits::{FruitsDifficultyAttributes, FruitsPP, FruitsPerformanceAttributes};
|
||||||
|
|
||||||
#[cfg(feature = "mania")]
|
#[cfg(feature = "mania")]
|
||||||
use crate::mania::{ManiaDifficultyAttributes, ManiaPP};
|
use crate::mania::{ManiaDifficultyAttributes, ManiaPP, ManiaPerformanceAttributes};
|
||||||
|
|
||||||
#[cfg(feature = "osu")]
|
#[cfg(feature = "osu")]
|
||||||
use crate::osu::{OsuDifficultyAttributes, OsuPP};
|
use crate::osu::{OsuDifficultyAttributes, OsuPP, OsuPerformanceAttributes};
|
||||||
|
|
||||||
#[cfg(feature = "taiko")]
|
#[cfg(feature = "taiko")]
|
||||||
use crate::taiko::{TaikoDifficultyAttributes, TaikoPP};
|
use crate::taiko::{TaikoDifficultyAttributes, TaikoPP, TaikoPerformanceAttributes};
|
||||||
|
|
||||||
/// Performance calculator on maps of any mode.
|
/// Performance calculator on maps of any mode.
|
||||||
///
|
///
|
||||||
@@ -367,3 +367,31 @@ impl AttributeProvider for TaikoDifficultyAttributes {
|
|||||||
DifficultyAttributes::Taiko(self)
|
DifficultyAttributes::Taiko(self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "fruits")]
|
||||||
|
impl AttributeProvider for FruitsPerformanceAttributes {
|
||||||
|
fn attributes(self) -> DifficultyAttributes {
|
||||||
|
DifficultyAttributes::Fruits(self.difficulty)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "mania")]
|
||||||
|
impl AttributeProvider for ManiaPerformanceAttributes {
|
||||||
|
fn attributes(self) -> DifficultyAttributes {
|
||||||
|
DifficultyAttributes::Mania(self.difficulty)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "osu")]
|
||||||
|
impl AttributeProvider for OsuPerformanceAttributes {
|
||||||
|
fn attributes(self) -> DifficultyAttributes {
|
||||||
|
DifficultyAttributes::Osu(self.difficulty)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "taiko")]
|
||||||
|
impl AttributeProvider for TaikoPerformanceAttributes {
|
||||||
|
fn attributes(self) -> DifficultyAttributes {
|
||||||
|
DifficultyAttributes::Taiko(self.difficulty)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user