Trait rosu_pp::model::mode::IGameMode

source ·
pub trait IGameMode: Sized {
    type DifficultyAttributes;
    type Strains;
    type Performance<'map>;
    type GradualDifficulty;
    type GradualPerformance;

    // Required methods
    fn check_convert(map: &Beatmap) -> ConvertStatus;
    fn try_convert(map: &mut Beatmap) -> ConvertStatus;
    fn difficulty(
        difficulty: &Difficulty,
        map: &Converted<'_, Self>
    ) -> Self::DifficultyAttributes;
    fn strains(
        difficulty: &Difficulty,
        map: &Converted<'_, Self>
    ) -> Self::Strains;
    fn performance(map: Converted<'_, Self>) -> Self::Performance<'_>;
    fn gradual_difficulty(
        difficulty: Difficulty,
        map: &Converted<'_, Self>
    ) -> Self::GradualDifficulty;
    fn gradual_performance(
        difficulty: Difficulty,
        map: &Converted<'_, Self>
    ) -> Self::GradualPerformance;
}
Expand description

A way to specify a gamemode at compile-time.

Notably, this is implemented for the marker types Osu, Taiko, Catch, and Mania.

Required Associated Types§

source

type DifficultyAttributes

The resulting type of a difficulty calculation.

source

type Strains

The resulting type of a strain calculation.

source

type Performance<'map>

The type of a performance calculator.

source

type GradualDifficulty

The type of a gradual difficulty calculator.

source

type GradualPerformance

The type of a gradual performance calculator.

Required Methods§

source

fn check_convert(map: &Beatmap) -> ConvertStatus

Check whether the map’s mode can be converted to the current type.

source

fn try_convert(map: &mut Beatmap) -> ConvertStatus

Attempt to convert a beatmap.

In case ConvertStatus::Incompatible is returned, the map is not modified.

source

fn difficulty( difficulty: &Difficulty, map: &Converted<'_, Self> ) -> Self::DifficultyAttributes

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

source

fn strains(difficulty: &Difficulty, map: &Converted<'_, Self>) -> Self::Strains

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

source

fn performance(map: Converted<'_, Self>) -> Self::Performance<'_>

Create a performance calculator for a Converted beatmap.

source

fn gradual_difficulty( difficulty: Difficulty, map: &Converted<'_, Self> ) -> Self::GradualDifficulty

Create a gradual difficulty calculator for a Converted beatmap.

source

fn gradual_performance( difficulty: Difficulty, map: &Converted<'_, Self> ) -> Self::GradualPerformance

Create a gradual performance calculator for a Converted beatmap.

Object Safety§

This trait is not object safe.

Implementors§