pub struct Beatmap {Show 16 fields
pub version: i32,
pub is_convert: bool,
pub stack_leniency: f32,
pub mode: GameMode,
pub ar: f32,
pub cs: f32,
pub hp: f32,
pub od: f32,
pub slider_multiplier: f64,
pub slider_tick_rate: f64,
pub breaks: Vec<BreakPeriod>,
pub timing_points: Vec<TimingPoint>,
pub difficulty_points: Vec<DifficultyPoint>,
pub effect_points: Vec<EffectPoint>,
pub hit_objects: Vec<HitObject>,
pub hit_sounds: Vec<HitSoundType>,
}
Expand description
All beatmap data that is relevant for difficulty and performance calculation.
Fields§
§version: i32
§is_convert: bool
§stack_leniency: f32
§mode: GameMode
§ar: f32
§cs: f32
§hp: f32
§od: f32
§slider_multiplier: f64
§slider_tick_rate: f64
§breaks: Vec<BreakPeriod>
§timing_points: Vec<TimingPoint>
§difficulty_points: Vec<DifficultyPoint>
§effect_points: Vec<EffectPoint>
§hit_objects: Vec<HitObject>
§hit_sounds: Vec<HitSoundType>
Implementations§
Source§impl Beatmap
impl Beatmap
Sourcepub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self, Error>
pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self, Error>
Parse a Beatmap
by providing a path to a .osu
file.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
Parse a Beatmap
by providing the content of a .osu
file as a
slice of bytes.
Sourcepub fn attributes(&self) -> BeatmapAttributesBuilder
pub fn attributes(&self) -> BeatmapAttributesBuilder
Returns a BeatmapAttributesBuilder
to calculate modified beatmap
attributes.
Sourcepub fn performance(&self) -> Performance<'_>
pub fn performance(&self) -> Performance<'_>
Create a performance calculator for this Beatmap
.
Sourcepub fn gradual_difficulty(&self, difficulty: Difficulty) -> GradualDifficulty ⓘ
pub fn gradual_difficulty(&self, difficulty: Difficulty) -> GradualDifficulty ⓘ
Create a gradual difficulty calculator for this Beatmap
.
Sourcepub fn gradual_performance(&self, difficulty: Difficulty) -> GradualPerformance
pub fn gradual_performance(&self, difficulty: Difficulty) -> GradualPerformance
Create a gradual performance calculator for this Beatmap
.
Sourcepub fn total_break_time(&self) -> f64
pub fn total_break_time(&self) -> f64
Sum up the duration of all breaks (in milliseconds).
Sourcepub fn convert(
self,
mode: GameMode,
mods: &GameMods,
) -> Result<Self, ConvertError>
pub fn convert( self, mode: GameMode, mods: &GameMods, ) -> Result<Self, ConvertError>
Attempt to convert a Beatmap
to the specified mode.
Sourcepub fn convert_ref(
&self,
mode: GameMode,
mods: &GameMods,
) -> Result<Cow<'_, Self>, ConvertError>
pub fn convert_ref( &self, mode: GameMode, mods: &GameMods, ) -> Result<Cow<'_, Self>, ConvertError>
Attempt to convert a &Beatmap
to the specified mode.
Sourcepub fn convert_mut(
&mut self,
mode: GameMode,
mods: &GameMods,
) -> Result<(), ConvertError>
pub fn convert_mut( &mut self, mode: GameMode, mods: &GameMods, ) -> Result<(), ConvertError>
Attempt to convert a &mut Beatmap
to the specified mode.
Sourcepub fn check_suspicion(&self) -> Result<(), TooSuspicious>
pub fn check_suspicion(&self) -> Result<(), TooSuspicious>
Check whether hitobjects appear too suspicious for further calculation.
Sometimes a Beatmap
isn’t created for gameplay but rather to test
the limits of osu! itself. Difficulty- and/or performance calculation
should likely be avoided on these maps due to potential performance
issues.
Trait Implementations§
Source§impl DecodeBeatmap for Beatmap
impl DecodeBeatmap for Beatmap
Source§type Error = ParseBeatmapError
type Error = ParseBeatmapError
Source§type State = BeatmapState
type State = BeatmapState
Self
at the end.Source§fn parse_general(state: &mut Self::State, line: &str) -> Result<(), Self::Error>
fn parse_general(state: &mut Self::State, line: &str) -> Result<(), Self::Error>
[General]
section.Source§fn parse_editor(_: &mut Self::State, _: &str) -> Result<(), Self::Error>
fn parse_editor(_: &mut Self::State, _: &str) -> Result<(), Self::Error>
[Editor]
section.Source§fn parse_metadata(_: &mut Self::State, _: &str) -> Result<(), Self::Error>
fn parse_metadata(_: &mut Self::State, _: &str) -> Result<(), Self::Error>
[Metadata]
section.Source§fn parse_difficulty(
state: &mut Self::State,
line: &str,
) -> Result<(), Self::Error>
fn parse_difficulty( state: &mut Self::State, line: &str, ) -> Result<(), Self::Error>
[Difficulty]
section.Source§fn parse_events(state: &mut Self::State, line: &str) -> Result<(), Self::Error>
fn parse_events(state: &mut Self::State, line: &str) -> Result<(), Self::Error>
[Events]
section.Source§fn parse_timing_points(
state: &mut Self::State,
line: &str,
) -> Result<(), Self::Error>
fn parse_timing_points( state: &mut Self::State, line: &str, ) -> Result<(), Self::Error>
[TimingPoints]
section.Source§fn parse_colors(_: &mut Self::State, _: &str) -> Result<(), Self::Error>
fn parse_colors(_: &mut Self::State, _: &str) -> Result<(), Self::Error>
[Colours]
section.Source§fn parse_hit_objects(
state: &mut Self::State,
line: &str,
) -> Result<(), Self::Error>
fn parse_hit_objects( state: &mut Self::State, line: &str, ) -> Result<(), Self::Error>
[HitObjects]
section.Source§fn parse_variables(_: &mut Self::State, _: &str) -> Result<(), Self::Error>
fn parse_variables(_: &mut Self::State, _: &str) -> Result<(), Self::Error>
[Variables]
section.Source§fn parse_catch_the_beat(_: &mut Self::State, _: &str) -> Result<(), Self::Error>
fn parse_catch_the_beat(_: &mut Self::State, _: &str) -> Result<(), Self::Error>
[CatchTheBeat]
section.Source§fn parse_mania(_: &mut Self::State, _: &str) -> Result<(), Self::Error>
fn parse_mania(_: &mut Self::State, _: &str) -> Result<(), Self::Error>
[Mania]
section.