removed last_control_point field from HitObjectKind::Slider
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
## Upcoming
|
## Upcoming
|
||||||
|
|
||||||
- Added method `Beatmap::from_path` so the file does not have to be created manually for `Beatmap::parse`.
|
- 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 `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
|
# v0.3.0
|
||||||
|
|
||||||
|
|||||||
@@ -77,8 +77,6 @@ pub enum HitObjectKind {
|
|||||||
pixel_len: f64,
|
pixel_len: f64,
|
||||||
/// The amount of spans of the slider.
|
/// The amount of spans of the slider.
|
||||||
span_count: usize,
|
span_count: usize,
|
||||||
/// The position of the last control point.
|
|
||||||
last_control_point: Pos2,
|
|
||||||
},
|
},
|
||||||
/// A spinner object.
|
/// A spinner object.
|
||||||
Spinner {
|
Spinner {
|
||||||
|
|||||||
+1
-18
@@ -546,29 +546,12 @@ macro_rules! parse_hitobjects_body {
|
|||||||
|
|
||||||
#[cfg(not(feature = "sliders"))]
|
#[cfg(not(feature = "sliders"))]
|
||||||
{
|
{
|
||||||
let last_control_point = split
|
let span_count = split.nth(1).next_field("repeats")?.parse()?;
|
||||||
.next()
|
|
||||||
.next_field("control points")?
|
|
||||||
.split('|')
|
|
||||||
.next_back();
|
|
||||||
|
|
||||||
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()?;
|
let pixel_len = split.next().next_field("pixel len")?.parse()?;
|
||||||
|
|
||||||
HitObjectKind::Slider {
|
HitObjectKind::Slider {
|
||||||
span_count,
|
span_count,
|
||||||
pixel_len,
|
pixel_len,
|
||||||
last_control_point,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
None => HitObjectKind::Circle,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if kind & Self::SPINNER_FLAG > 0 {
|
} else if kind & Self::SPINNER_FLAG > 0 {
|
||||||
|
|||||||
@@ -1,20 +1,16 @@
|
|||||||
use crate::{
|
use crate::{Beatmap, DifficultyAttributes, GameMode, PerformanceAttributes};
|
||||||
fruits::FruitsDifficultyAttributes, mania::ManiaDifficultyAttributes,
|
|
||||||
osu::OsuDifficultyAttributes, taiko::TaikoDifficultyAttributes, Beatmap, DifficultyAttributes,
|
|
||||||
GameMode, PerformanceAttributes,
|
|
||||||
};
|
|
||||||
|
|
||||||
#[cfg(feature = "fruits")]
|
#[cfg(feature = "fruits")]
|
||||||
use crate::FruitsPP;
|
use crate::fruits::{FruitsDifficultyAttributes, FruitsPP};
|
||||||
|
|
||||||
#[cfg(feature = "mania")]
|
#[cfg(feature = "mania")]
|
||||||
use crate::ManiaPP;
|
use crate::mania::{ManiaDifficultyAttributes, ManiaPP};
|
||||||
|
|
||||||
#[cfg(feature = "osu")]
|
#[cfg(feature = "osu")]
|
||||||
use crate::OsuPP;
|
use crate::osu::{OsuDifficultyAttributes, OsuPP};
|
||||||
|
|
||||||
#[cfg(feature = "taiko")]
|
#[cfg(feature = "taiko")]
|
||||||
use crate::TaikoPP;
|
use crate::taiko::{TaikoDifficultyAttributes, TaikoPP};
|
||||||
|
|
||||||
/// Performance calculator on maps of any mode.
|
/// Performance calculator on maps of any mode.
|
||||||
///
|
///
|
||||||
|
|||||||
Reference in New Issue
Block a user