Struct rosu_pp::ManiaPP[][src]

pub struct ManiaPP<'m> { /* fields omitted */ }

Calculator for pp on osu!mania maps.

Example

let map: Beatmap = ...
let pp_result: PpResult = ManiaPP::new(&map)
    .mods(64) // DT
    .score(765_432)
    .calculate();

println!("PP: {} | Stars: {}", pp_result.pp(), pp_result.stars());

let next_result = ManiaPP::new(&map)
    .attributes(pp_result)  // reusing previous results for performance
    .mods(8 + 64)           // has to be the same to reuse attributes
    .score(950_000)
    .calculate();

println!("PP: {} | Stars: {}", next_result.pp(), next_result.stars());

Implementations

impl<'m> ManiaPP<'m>[src]

pub fn new(map: &'m Beatmap) -> Self[src]

pub fn attributes(self, attributes: impl ManiaAttributeProvider) -> Self[src]

ManiaAttributeProvider is implemented by f32, StarResult, and by PpResult meaning you can give the star rating, the result of a star calculation, or the result of a pp calculation. If you already calculated the attributes for the current map-mod combination, be sure to put them in here so that they don’t have to be recalculated.

pub fn mods(self, mods: u32) -> Self[src]

Specify mods through their bit values.

See https://github.com/ppy/osu-api/wiki#mods

pub fn score(self, score: u32) -> Self[src]

Specify the score of a play. On NoMod its between 0 and 1,000,000, on Easy between 0 and 500,000, etc.

pub fn passed_objects(self, passed_objects: usize) -> Self[src]

Amount of passed objects for partial plays, e.g. a fail.

pub fn calculate(self) -> PpResult[src]

Returns an object which contains the pp and stars.

Trait Implementations

impl<'m> Clone for ManiaPP<'m>[src]

impl<'m> Debug for ManiaPP<'m>[src]

Auto Trait Implementations

impl<'m> RefUnwindSafe for ManiaPP<'m>

impl<'m> Send for ManiaPP<'m>

impl<'m> Sync for ManiaPP<'m>

impl<'m> Unpin for ManiaPP<'m>

impl<'m> UnwindSafe for ManiaPP<'m>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.