Struct rosu_pp::taiko::TaikoPerformance
source · pub struct TaikoPerformance<'map> { /* private fields */ }
Expand description
Performance calculator on osu!taiko maps.
Implementations§
source§impl<'map> TaikoPerformance<'map>
impl<'map> TaikoPerformance<'map>
sourcepub fn new(map_or_attrs: impl IntoModePerformance<'map, Taiko>) -> Self
pub fn new(map_or_attrs: impl IntoModePerformance<'map, Taiko>) -> Self
Create a new performance calculator for osu!taiko maps.
The argument map_or_attrs
must be either
- previously calculated attributes (
TaikoDifficultyAttributes
orTaikoPerformanceAttributes
) - a beatmap (
TaikoBeatmap<'map>
)
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!taiko maps.
Returns None
if map_or_attrs
does not belong to osu!taiko e.g.
a Converted
, DifficultyAttributes
, or PerformanceAttributes
of a different mode.
See TaikoPerformance::new
for more information.
sourcepub const fn hitresult_priority(self, priority: HitResultPriority) -> Self
pub const fn hitresult_priority(self, priority: HitResultPriority) -> Self
Specify how hitresults should be generated.
Defauls to HitResultPriority::BestCase
.
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 const fn difficulty(self, difficulty: Difficulty) -> Self
pub const fn difficulty(self, difficulty: Difficulty) -> Self
Use the specified settings of the given Difficulty
.
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.
If you want to calculate the performance after every few objects,
instead of using TaikoPerformance
multiple times with different
passed_objects
, you should use TaikoGradualPerformance
.
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 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 state(self, state: TaikoScoreState) -> Self
pub const fn state(self, state: TaikoScoreState) -> Self
Provide parameters through a TaikoScoreState
.
sourcepub fn generate_state(&mut self) -> TaikoScoreState
pub fn generate_state(&mut self) -> TaikoScoreState
Create the TaikoScoreState
that will be used for performance calculation.
sourcepub fn calculate(self) -> TaikoPerformanceAttributes
pub fn calculate(self) -> TaikoPerformanceAttributes
Calculate all performance related values, including pp and stars.
Trait Implementations§
source§impl<'map> Clone for TaikoPerformance<'map>
impl<'map> Clone for TaikoPerformance<'map>
source§fn clone(&self) -> TaikoPerformance<'map>
fn clone(&self) -> TaikoPerformance<'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 TaikoPerformance<'map>
impl<'map> Debug for TaikoPerformance<'map>
source§impl<'map, T: IntoModePerformance<'map, Taiko>> From<T> for TaikoPerformance<'map>
impl<'map, T: IntoModePerformance<'map, Taiko>> From<T> for TaikoPerformance<'map>
source§impl<'map> PartialEq for TaikoPerformance<'map>
impl<'map> PartialEq for TaikoPerformance<'map>
source§fn eq(&self, other: &TaikoPerformance<'map>) -> bool
fn eq(&self, other: &TaikoPerformance<'map>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<'map> TryFrom<OsuPerformance<'map>> for TaikoPerformance<'map>
impl<'map> TryFrom<OsuPerformance<'map>> for TaikoPerformance<'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 TaikoPerformance
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.