Struct peace_performance::FruitsPP [−][src]
pub struct FruitsPP<'m> { /* fields omitted */ }
Expand description
Calculator for pp on osu!ctb maps.
Example
let map: Beatmap = ... let pp_result: PpResult = FruitsPP::new(&map) .mods(8 + 64) // HDDT .combo(1234) .misses(1) .accuracy(98.5) .calculate(); println!("PP: {} | Stars: {}", pp_result.pp(), pp_result.stars()); let next_result = FruitsPP::new(&map) .attributes(pp_result) // reusing previous results for performance .mods(8 + 64) // has to be the same to reuse attributes .accuracy(99.5) .calculate(); println!("PP: {} | Stars: {}", next_result.pp(), next_result.stars());
Implementations
FruitsAttributeProvider
is implemented by DifficultyAttributes
,
StarResult
, and by PpResult
meaning you can give the
result of a star calculation or 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.
Specify mods through their bit values.
Specify the amount of droplets of a play i.e. n100.
Specify the amount of tiny droplets of a play i.e. n50.
Specify the amount of tiny droplet misses of a play i.e. n_katu.
Specify the amount of fruit / droplet misses of the play.
Amount of passed objects for partial plays, e.g. a fail.
Generate the hit results with respect to the given accuracy between 0
and 100
.
Be sure to set misses
beforehand! Also, if available, set attributes
beforehand.
Set acc value
If it is used to calculate the PP of multiple different ACCs, it should be called from high to low according to the ACC value, otherwise it is invalid.
Examples:
// valid let acc_100 = { c.set_accuracy(100.0); c.calculate().await }; let acc_99 = { c.set_accuracy(99.0); c.calculate().await }; let acc_98 = { c.set_accuracy(98.0); c.calculate().await }; let acc_95 = { c.set_accuracy(95.0); c.calculate().await }; // invalid let acc_95 = { c.set_accuracy(95.0); c.calculate().await }; let acc_98 = { c.set_accuracy(98.0); c.calculate().await }; let acc_99 = { c.set_accuracy(99.0); c.calculate().await }; let acc_100 = { c.set_accuracy(100.0); c.calculate().await };
Returns an object which contains the pp and DifficultyAttributes
containing stars and other attributes.
Trait Implementations
Auto Trait Implementations
impl<'m> RefUnwindSafe for FruitsPP<'m>
impl<'m> UnwindSafe for FruitsPP<'m>
Blanket Implementations
Mutably borrows from an owned value. Read more