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 const fn attributes(&self) -> BeatmapAttributesBuilder
pub const 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_in_place(&mut self, mode: GameMode) -> ConvertStatus
pub fn convert_in_place(&mut self, mode: GameMode) -> ConvertStatus
Convert a &mut Beatmap
to the specified mode with an argument
instead of a generic parameter.
sourcepub fn try_as_converted<M: IGameMode>(&self) -> Option<Converted<'_, M>>
pub fn try_as_converted<M: IGameMode>(&self) -> Option<Converted<'_, M>>
Attempt to convert a &Beatmap
to the specified mode.
If the conversion is incompatible, None
is returned.
sourcepub fn unchecked_as_converted<M: IGameMode>(&self) -> Converted<'_, M>
pub fn unchecked_as_converted<M: IGameMode>(&self) -> Converted<'_, M>
sourcepub fn try_as_converted_mut<M: IGameMode>(&mut self) -> Option<Converted<'_, M>>
pub fn try_as_converted_mut<M: IGameMode>(&mut self) -> Option<Converted<'_, M>>
Attempt to convert a &mut Beatmap
to the specified mode.
If the conversion is incompatible, None
is returned.
sourcepub fn unchecked_as_converted_mut<M: IGameMode>(&mut self) -> Converted<'_, M>
pub fn unchecked_as_converted_mut<M: IGameMode>(&mut self) -> Converted<'_, M>
sourcepub fn try_into_converted<'a, M: IGameMode>(
self
) -> Result<Converted<'a, M>, Self>
pub fn try_into_converted<'a, M: IGameMode>( self ) -> Result<Converted<'a, M>, Self>
Trait Implementations§
source§impl DecodeBeatmap for Beatmap
impl DecodeBeatmap for Beatmap
§type Error = ParseBeatmapError
type Error = ParseBeatmapError
§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.