pub struct Difficulty { /* private fields */ }
Expand description
Difficulty calculator on maps of any mode.
§Example
use rosu_pp::{Beatmap, Difficulty, any::DifficultyAttributes};
let map = Beatmap::from_path("./resources/2118524.osu").unwrap();
let attrs: DifficultyAttributes = Difficulty::new()
.mods(8 + 1024) // HDFL
.calculate(&map);
Implementations§
Source§impl Difficulty
impl Difficulty
Sourcepub fn inspect(self) -> InspectDifficulty
pub fn inspect(self) -> InspectDifficulty
Turn this Difficulty
into a InspectDifficulty
to inspect its
configured values.
Sourcepub fn mods(self, mods: impl Into<GameMods>) -> Self
pub fn mods(self, mods: impl Into<GameMods>) -> Self
Specify mods.
Accepted types are
Sourcepub const fn passed_objects(self, passed_objects: u32) -> Self
pub const fn passed_objects(self, passed_objects: u32) -> Self
Amount of passed objects for partial plays, e.g. a fail.
Sourcepub fn clock_rate(self, clock_rate: f64) -> Self
pub fn clock_rate(self, clock_rate: f64) -> Self
Adjust the clock rate used in the calculation.
If none is specified, it will take the clock rate based on the mods i.e. 1.5 for DT, 0.75 for HT and 1.0 otherwise.
Minimum | Maximum |
---|---|
0.01 | 100 |
Sourcepub fn ar(self, ar: f32, with_mods: bool) -> Self
pub fn ar(self, ar: f32, with_mods: bool) -> Self
Override a beatmap’s set AR.
Only relevant for osu! and osu!catch.
with_mods
determines if the given value should be used before
or after accounting for mods, e.g. on true
the value will be
used as is and on false
it will be modified based on the mods.
Minimum | Maximum |
---|---|
-20 | 20 |
Sourcepub fn cs(self, cs: f32, with_mods: bool) -> Self
pub fn cs(self, cs: f32, with_mods: bool) -> Self
Override a beatmap’s set CS.
Only relevant for osu! and osu!catch.
with_mods
determines if the given value should be used before
or after accounting for mods, e.g. on true
the value will be
used as is and on false
it will be modified based on the mods.
Minimum | Maximum |
---|---|
-20 | 20 |
Sourcepub fn hp(self, hp: f32, with_mods: bool) -> Self
pub fn hp(self, hp: f32, with_mods: bool) -> Self
Override a beatmap’s set HP.
with_mods
determines if the given value should be used before
or after accounting for mods, e.g. on true
the value will be
used as is and on false
it will be modified based on the mods.
Minimum | Maximum |
---|---|
-20 | 20 |
Sourcepub fn od(self, od: f32, with_mods: bool) -> Self
pub fn od(self, od: f32, with_mods: bool) -> Self
Override a beatmap’s set OD.
with_mods
determines if the given value should be used before
or after accounting for mods, e.g. on true
the value will be
used as is and on false
it will be modified based on the mods.
Minimum | Maximum |
---|---|
-20 | 20 |
Sourcepub const fn hardrock_offsets(self, hardrock_offsets: bool) -> Self
pub const fn hardrock_offsets(self, hardrock_offsets: bool) -> Self
Adjust patterns as if the HR mod is enabled.
Only relevant for osu!catch.
Sourcepub const fn lazer(self, lazer: bool) -> Self
pub const fn lazer(self, lazer: bool) -> Self
Whether the calculated attributes belong to an osu!lazer or osu!stable score.
Defaults to true
.
Sourcepub fn calculate(&self, map: &Beatmap) -> DifficultyAttributes
pub fn calculate(&self, map: &Beatmap) -> DifficultyAttributes
Perform the difficulty calculation.
Sourcepub fn calculate_for_mode<M: IGameMode>(
&self,
map: &Beatmap,
) -> Result<M::DifficultyAttributes, ConvertError>
pub fn calculate_for_mode<M: IGameMode>( &self, map: &Beatmap, ) -> Result<M::DifficultyAttributes, ConvertError>
Perform the difficulty calculation for a specific IGameMode
.
Sourcepub fn strains(&self, map: &Beatmap) -> Strains
pub fn strains(&self, map: &Beatmap) -> Strains
Perform the difficulty calculation but instead of evaluating the skill strains, return them as is.
Suitable to plot the difficulty of a map over time.
Sourcepub fn strains_for_mode<M: IGameMode>(
&self,
map: &Beatmap,
) -> Result<M::Strains, ConvertError>
pub fn strains_for_mode<M: IGameMode>( &self, map: &Beatmap, ) -> Result<M::Strains, ConvertError>
Perform the strain calculation for a specific IGameMode
.
Sourcepub fn gradual_difficulty(self, map: &Beatmap) -> GradualDifficulty ⓘ
pub fn gradual_difficulty(self, map: &Beatmap) -> GradualDifficulty ⓘ
Create a gradual difficulty calculator for a Beatmap
.
Sourcepub fn gradual_difficulty_for_mode<M: IGameMode>(
self,
map: &Beatmap,
) -> Result<M::GradualDifficulty, ConvertError>
pub fn gradual_difficulty_for_mode<M: IGameMode>( self, map: &Beatmap, ) -> Result<M::GradualDifficulty, ConvertError>
Sourcepub fn gradual_performance(self, map: &Beatmap) -> GradualPerformance
pub fn gradual_performance(self, map: &Beatmap) -> GradualPerformance
Create a gradual performance calculator for a Beatmap
.
Sourcepub fn gradual_performance_for_mode<M: IGameMode>(
self,
map: &Beatmap,
) -> Result<M::GradualPerformance, ConvertError>
pub fn gradual_performance_for_mode<M: IGameMode>( self, map: &Beatmap, ) -> Result<M::GradualPerformance, ConvertError>
Trait Implementations§
Source§impl Clone for Difficulty
impl Clone for Difficulty
Source§fn clone(&self) -> Difficulty
fn clone(&self) -> Difficulty
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more