made control point types pub

This commit is contained in:
MaxOhn
2022-06-21 07:56:28 +02:00
parent d0db4a1775
commit 5fdec291ec
4 changed files with 21 additions and 7 deletions
+8
View File
@@ -32,6 +32,8 @@ use std::path::Path;
#[cfg(feature = "async_std")]
use async_std::{fs::File, io::Read as AsyncRead, path::Path};
use crate::control_point_iter::ControlPointIter;
fn sort_unstable<T: PartialOrd>(slice: &mut [T]) {
slice.sort_unstable_by(|p1, p2| p1.partial_cmp(p2).unwrap_or(Ordering::Equal));
}
@@ -681,6 +683,12 @@ impl Beatmap {
None => 0.0,
}
}
/// Create an iterator over the map's timing- and difficulty points sorted by timestamp.
#[inline]
pub fn control_points(&self) -> ControlPointIter<'_> {
ControlPointIter::new(self)
}
}
mod slider_parsing {