pub struct CatchPerformance<'map> { /* private fields */ }Expand description
Performance calculator on osu!catch maps.
Implementations§
Source§impl<'map> CatchPerformance<'map>
impl<'map> CatchPerformance<'map>
Sourcepub fn new(map_or_attrs: impl IntoModePerformance<'map, Catch>) -> Self
pub fn new(map_or_attrs: impl IntoModePerformance<'map, Catch>) -> Self
Create a new performance calculator for osu!catch maps.
The argument map_or_attrs must be either
- previously calculated attributes (
CatchDifficultyAttributesorCatchPerformanceAttributes) - a
Beatmap(by reference or value)
If a map is given, difficulty attributes will need to be calculated internally which is a costly operation. Hence, passing attributes should be prefered.
However, when passing previously calculated attributes, make sure they
have been calculated for the same map and Difficulty settings.
Otherwise, the final attributes will be incorrect.
Sourcepub fn try_new(map_or_attrs: impl IntoPerformance<'map>) -> Option<Self>
pub fn try_new(map_or_attrs: impl IntoPerformance<'map>) -> Option<Self>
Try to create a new performance calculator for osu!catch maps.
Returns None if map_or_attrs does not belong to osu!catch i.e.
a DifficultyAttributes or PerformanceAttributes of a different
mode.
See CatchPerformance::new for more information.
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 fruits(self, n_fruits: u32) -> Self
pub const fn fruits(self, n_fruits: u32) -> Self
Specify the amount of fruits of a play i.e. n300.
Sourcepub const fn droplets(self, n_droplets: u32) -> Self
pub const fn droplets(self, n_droplets: u32) -> Self
Specify the amount of droplets of a play i.e. n100.
Sourcepub const fn tiny_droplets(self, n_tiny_droplets: u32) -> Self
pub const fn tiny_droplets(self, n_tiny_droplets: u32) -> Self
Specify the amount of tiny droplets of a play i.e. n50.
Sourcepub const fn tiny_droplet_misses(self, n_tiny_droplet_misses: u32) -> Self
pub const fn tiny_droplet_misses(self, n_tiny_droplet_misses: u32) -> Self
Specify the amount of tiny droplet misses of a play i.e. n_katu.
Sourcepub const fn misses(self, n_misses: u32) -> Self
pub const fn misses(self, n_misses: u32) -> Self
Specify the amount of fruit / droplet misses of the play.
Sourcepub fn difficulty(self, difficulty: Difficulty) -> Self
pub fn difficulty(self, difficulty: Difficulty) -> Self
Use the specified settings of the given Difficulty.
Sourcepub fn passed_objects(self, passed_objects: u32) -> Self
pub fn passed_objects(self, passed_objects: u32) -> Self
Amount of passed objects for partial plays, e.g. a fail.
If you want to calculate the performance after every few objects,
instead of using CatchPerformance multiple times with different
passed_objects, you should use CatchGradualPerformance.
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.
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.
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 fn hardrock_offsets(self, hardrock_offsets: bool) -> Self
pub fn hardrock_offsets(self, hardrock_offsets: bool) -> Self
Adjust patterns as if the HR mod is enabled.
Sourcepub const fn state(self, state: CatchScoreState) -> Self
pub const fn state(self, state: CatchScoreState) -> Self
Provide parameters through an CatchScoreState.
Sourcepub fn accuracy(self, acc: f64) -> Self
pub fn accuracy(self, acc: f64) -> Self
Specify the accuracy of a play between 0.0 and 100.0.
This will be used to generate matching hitresults.
Sourcepub fn generate_state(&mut self) -> Result<CatchScoreState, ConvertError>
pub fn generate_state(&mut self) -> Result<CatchScoreState, ConvertError>
Create the CatchScoreState that will be used for performance calculation.
Sourcepub fn calculate(self) -> Result<CatchPerformanceAttributes, ConvertError>
pub fn calculate(self) -> Result<CatchPerformanceAttributes, ConvertError>
Calculate all performance related values, including pp and stars.
Trait Implementations§
Source§impl<'map> Clone for CatchPerformance<'map>
impl<'map> Clone for CatchPerformance<'map>
Source§fn clone(&self) -> CatchPerformance<'map>
fn clone(&self) -> CatchPerformance<'map>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'map> Debug for CatchPerformance<'map>
impl<'map> Debug for CatchPerformance<'map>
Source§impl<'map, T: IntoModePerformance<'map, Catch>> From<T> for CatchPerformance<'map>
impl<'map, T: IntoModePerformance<'map, Catch>> From<T> for CatchPerformance<'map>
Source§impl<'map> PartialEq for CatchPerformance<'map>
impl<'map> PartialEq for CatchPerformance<'map>
Source§impl<'map> TryFrom<OsuPerformance<'map>> for CatchPerformance<'map>
impl<'map> TryFrom<OsuPerformance<'map>> for CatchPerformance<'map>
Source§fn try_from(osu: OsuPerformance<'map>) -> Result<Self, Self::Error>
fn try_from(osu: OsuPerformance<'map>) -> Result<Self, Self::Error>
Try to create CatchPerformance through OsuPerformance.
Returns None if OsuPerformance does not contain a beatmap, i.e.
if it was constructed through attributes or
OsuPerformance::generate_state was called.