Beatsaber Rust Utilities: A Beatsaber V3 parsing library.
beatsaber
beatmap
1//! Defines the structure of a map's difficulty file(s) (i.e. `ExpertStandard.dat`).
2
3pub mod gameplay_event;
4pub mod lightshow;
5pub mod playfield;
6
7#[doc(hidden)]
8pub use gameplay_event::*;
9#[doc(hidden)]
10pub use lightshow::*;
11#[doc(hidden)]
12pub use playfield::*;
13
14use serde::{Deserialize, Serialize};
15
16/// A map's difficulty file(s) (i.e. `ExpertStandard.dat`).
17#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
18#[serde(rename_all = "camelCase")]
19#[cfg_attr(
20 feature = "bevy_reflect",
21 derive(bevy_reflect::Reflect),
22 reflect(Debug, Clone, PartialEq)
23)]
24pub struct Difficulty {
25 /// The difficulty file version, in the form of `3.2.0`.
26 pub version: String,
27 pub bpm_events: Vec<BpmEvent>,
28 #[serde(rename = "rotationEvents")]
29 pub lane_rotation_events: Vec<LaneRotationEvent>,
30 #[serde(rename = "colorNotes")]
31 pub notes: Vec<Note>,
32 #[serde(rename = "bombNotes")]
33 pub bombs: Vec<Bomb>,
34 #[serde(rename = "obstacles")]
35 pub walls: Vec<Wall>,
36 #[serde(rename = "sliders")]
37 pub arcs: Vec<Arc>,
38 #[serde(rename = "burstSliders")]
39 pub chains: Vec<Chain>,
40 pub waypoints: Vec<Waypoint>,
41 #[serde(rename = "basicBeatmapEvents")]
42 pub basic_events: Vec<BasicEvent>,
43 #[serde(rename = "colorBoostBeatmapEvents")]
44 pub color_boost_events: Vec<ColorBoostEvent>,
45 #[serde(rename = "lightColorEventBoxGroups")]
46 pub color_event_boxes: Vec<ColorEventBox>,
47 #[serde(rename = "lightRotationEventBoxGroups")]
48 pub rotation_event_boxes: Vec<RotationEventBox>,
49 #[serde(flatten)]
50 pub fx_event_boxes: Option<FxEventContainer>,
51 /// > Only present in difficulty file V3.2 or higher.
52 #[serde(rename = "lightTranslationEventBoxGroups")]
53 pub translation_event_boxes: Option<Vec<TranslationEventBox>>,
54 #[doc(alias = "keyword_events")]
55 #[serde(rename = "basicEventTypesWithKeywords")]
56 pub special_events: SpecialEvent,
57 /// If false, overriding the environment in game will disable all lightshow events.
58 #[serde(rename = "useNormalEventsAsCompatibleEvents")]
59 pub use_compatible_events: bool,
60}