allow specifying map for map attrs builder later
This commit is contained in:
@@ -73,8 +73,8 @@ impl BeatmapAttributesBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a new [`BeatmapAttributesBuilder`] from a [`Beatmap`].
|
||||
pub const fn from_map(map: &Beatmap) -> Self {
|
||||
/// Use the given [`Beatmap`]'s attributes, mode, and convert status.
|
||||
pub const fn map(self, map: &Beatmap) -> Self {
|
||||
Self {
|
||||
mode: map.mode,
|
||||
ar: ModsDependent::new(map.ar),
|
||||
@@ -323,13 +323,13 @@ impl BeatmapAttributesBuilder {
|
||||
|
||||
impl From<&Beatmap> for BeatmapAttributesBuilder {
|
||||
fn from(map: &Beatmap) -> Self {
|
||||
Self::from_map(map)
|
||||
Self::new().map(map)
|
||||
}
|
||||
}
|
||||
|
||||
impl<M> From<&Converted<'_, M>> for BeatmapAttributesBuilder {
|
||||
fn from(converted: &Converted<'_, M>) -> Self {
|
||||
Self::from_map(converted)
|
||||
Self::new().map(converted)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ impl Beatmap {
|
||||
/// Returns a [`BeatmapAttributesBuilder`] to calculate modified beatmap
|
||||
/// attributes.
|
||||
pub const fn attributes(&self) -> BeatmapAttributesBuilder {
|
||||
BeatmapAttributesBuilder::from_map(self)
|
||||
BeatmapAttributesBuilder::new().map(self)
|
||||
}
|
||||
|
||||
/// The beats per minute of the map.
|
||||
|
||||
Reference in New Issue
Block a user