Struct rosu_pp::Difficulty
source · 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 const fn with_mode<M: IGameMode>(&self) -> ConvertedDifficulty<'_, M>
pub const fn with_mode<M: IGameMode>(&self) -> ConvertedDifficulty<'_, M>
Use this Difficulty
as a calculator for a specific IGameMode
.
Note that ConvertedDifficulty
won’t allow to further customize
fields so be sure they’re all set before converting to it.
sourcepub fn inspect(self) -> InspectDifficulty
pub fn inspect(self) -> InspectDifficulty
Turn this Difficulty
into a InspectDifficulty
to inspect its
configured values.
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 fn calculate(&self, map: &Beatmap) -> DifficultyAttributes
pub fn calculate(&self, map: &Beatmap) -> DifficultyAttributes
Perform the difficulty calculation.
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 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_performance(self, map: &Beatmap) -> GradualPerformance
pub fn gradual_performance(self, map: &Beatmap) -> GradualPerformance
Create a gradual performance calculator for a Beatmap
.
Trait Implementations§
source§impl<M> AsRef<Difficulty> for ConvertedDifficulty<'_, M>
impl<M> AsRef<Difficulty> for ConvertedDifficulty<'_, M>
source§fn as_ref(&self) -> &Difficulty
fn as_ref(&self) -> &Difficulty
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 moresource§impl Debug for Difficulty
impl Debug for Difficulty
source§impl Default for Difficulty
impl Default for Difficulty
source§impl<'a, M: IGameMode> From<&'a Difficulty> for ConvertedDifficulty<'a, M>
impl<'a, M: IGameMode> From<&'a Difficulty> for ConvertedDifficulty<'a, M>
source§fn from(difficulty: &'a Difficulty) -> Self
fn from(difficulty: &'a Difficulty) -> Self
source§impl From<Difficulty> for InspectDifficulty
impl From<Difficulty> for InspectDifficulty
source§fn from(difficulty: Difficulty) -> Self
fn from(difficulty: Difficulty) -> Self
source§impl From<InspectDifficulty> for Difficulty
impl From<InspectDifficulty> for Difficulty
source§fn from(difficulty: InspectDifficulty) -> Self
fn from(difficulty: InspectDifficulty) -> Self
source§impl PartialEq for Difficulty
impl PartialEq for Difficulty
source§fn eq(&self, other: &Difficulty) -> bool
fn eq(&self, other: &Difficulty) -> bool
self
and other
values to be equal, and is used
by ==
.