removed last_control_point field from HitObjectKind::Slider

This commit is contained in:
MaxOhn
2021-11-17 19:15:22 +01:00
parent fd1cae50e0
commit ac1fd76daa
4 changed files with 12 additions and 33 deletions
+2
View File
@@ -1,7 +1,9 @@
## Upcoming
- Added method `Beatmap::from_path` so the file does not have to be created manually for `Beatmap::parse`.
- Added a bunch of documentation.
- [BREAKING] Removed the `ParseError` variants `InvalidPathType` and `InvalidTimingSignature` and renamed `InvalidFloatingPoint` to `InvalidDecimalNumber`.
- [BREAKING] Removed the `last_control_point` field of `HitObjectKind::Slider` when neither the `osu` nor the `fruits` feature is enabled.
# v0.3.0
-2
View File
@@ -77,8 +77,6 @@ pub enum HitObjectKind {
pixel_len: f64,
/// The amount of spans of the slider.
span_count: usize,
/// The position of the last control point.
last_control_point: Pos2,
},
/// A spinner object.
Spinner {
+5 -22
View File
@@ -546,29 +546,12 @@ macro_rules! parse_hitobjects_body {
#[cfg(not(feature = "sliders"))]
{
let last_control_point = split
.next()
.next_field("control points")?
.split('|')
.next_back();
let span_count = split.nth(1).next_field("repeats")?.parse()?;
let pixel_len = split.next().next_field("pixel len")?.parse()?;
match last_control_point.map(|v| v.split(':').map(str::parse)) {
Some(mut coords) => {
let last_control_point = match (coords.next(), coords.next()) {
(Some(Ok(x)), Some(Ok(y))) => Pos2 { x, y },
_ => return Err(ParseError::InvalidCurvePoints),
};
let span_count = split.next().next_field("repeats")?.parse()?;
let pixel_len = split.next().next_field("pixel len")?.parse()?;
HitObjectKind::Slider {
span_count,
pixel_len,
last_control_point,
}
}
None => HitObjectKind::Circle,
HitObjectKind::Slider {
span_count,
pixel_len,
}
}
} else if kind & Self::SPINNER_FLAG > 0 {
+5 -9
View File
@@ -1,20 +1,16 @@
use crate::{
fruits::FruitsDifficultyAttributes, mania::ManiaDifficultyAttributes,
osu::OsuDifficultyAttributes, taiko::TaikoDifficultyAttributes, Beatmap, DifficultyAttributes,
GameMode, PerformanceAttributes,
};
use crate::{Beatmap, DifficultyAttributes, GameMode, PerformanceAttributes};
#[cfg(feature = "fruits")]
use crate::FruitsPP;
use crate::fruits::{FruitsDifficultyAttributes, FruitsPP};
#[cfg(feature = "mania")]
use crate::ManiaPP;
use crate::mania::{ManiaDifficultyAttributes, ManiaPP};
#[cfg(feature = "osu")]
use crate::OsuPP;
use crate::osu::{OsuDifficultyAttributes, OsuPP};
#[cfg(feature = "taiko")]
use crate::TaikoPP;
use crate::taiko::{TaikoDifficultyAttributes, TaikoPP};
/// Performance calculator on maps of any mode.
///