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