pub struct ConvertedDifficulty<'a, M> { /* private fields */ }
Expand description

Difficulty calculator on maps of a given mode.

§Example

use rosu_pp::{Beatmap, Difficulty};
use rosu_pp::catch::{Catch, CatchDifficultyAttributes};

let converted = Beatmap::from_path("./resources/2118524.osu")
    .unwrap()
    .unchecked_into_converted();

let attrs: CatchDifficultyAttributes = Difficulty::new()
    .mods(8 + 1024) // HDFL
    .with_mode::<Catch>() // -> `ConvertedDifficulty`
    .calculate(&converted);

Implementations§

source§

impl<'a, M> ConvertedDifficulty<'a, M>

source

pub const fn inner(self) -> &'a Difficulty

Return the internal Difficulty.

source

pub const fn cast<N: IGameMode>(self) -> ConvertedDifficulty<'a, N>

Cast from generic mode M to N.

source§

impl<M: IGameMode> ConvertedDifficulty<'_, M>

source

pub fn calculate(self, map: &Converted<'_, M>) -> M::DifficultyAttributes

Perform the difficulty calculation for a Converted beatmap and process the final skill values.

source

pub fn strains(self, map: &Converted<'_, M>) -> M::Strains

Perform a difficulty calculation for a Converted beatmap without processing the final skill values.

source

pub fn gradual_difficulty(self, map: &Converted<'_, M>) -> M::GradualDifficulty

Create a gradual difficulty calculator for a Converted beatmap.

source

pub fn gradual_performance( self, map: &Converted<'_, M> ) -> M::GradualPerformance

Create a gradual performance calculator for a Converted beatmap.

Trait Implementations§

source§

impl<M> AsRef<Difficulty> for ConvertedDifficulty<'_, M>

source§

fn as_ref(&self) -> &Difficulty

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<M> Clone for ConvertedDifficulty<'_, M>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<M> Debug for ConvertedDifficulty<'_, M>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult

Formats the value using the given formatter. Read more
source§

impl<'a, M: IGameMode> From<&'a Difficulty> for ConvertedDifficulty<'a, M>

source§

fn from(difficulty: &'a Difficulty) -> Self

Converts to this type from the input type.
source§

impl<M> PartialEq for ConvertedDifficulty<'_, M>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<M> Copy for ConvertedDifficulty<'_, M>

Auto Trait Implementations§

§

impl<'a, M> Freeze for ConvertedDifficulty<'a, M>

§

impl<'a, M> RefUnwindSafe for ConvertedDifficulty<'a, M>
where M: RefUnwindSafe,

§

impl<'a, M> Send for ConvertedDifficulty<'a, M>
where M: Send,

§

impl<'a, M> Sync for ConvertedDifficulty<'a, M>
where M: Sync,

§

impl<'a, M> Unpin for ConvertedDifficulty<'a, M>
where M: Unpin,

§

impl<'a, M> UnwindSafe for ConvertedDifficulty<'a, M>
where M: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.