···3333 pub preview_start_time: f32,
3434 #[serde(rename = "_previewDuration")]
3535 pub preview_duration: f32,
3636+ /// The path to the audio file, relative to the map's folder.
3637 #[serde(rename = "_songFilename")]
3738 pub audio_file: String,
3939+ /// The path to the cover image file, relative to the map's folder.
3840 #[serde(rename = "_coverImageFilename")]
3941 pub cover_image_file: String,
4042 #[serde(rename = "_environmentName")]
4143 pub environment: Environment,
4444+ /// The environment that will be used for 90 and 360 degree difficulties.
4545+ ///
4646+ /// Starting in info file V2.1, Individual difficulties can override this using [environment_index](DifficultyInfo::environment_index).
4247 #[serde(rename = "_allDirectionsEnvironmentName")]
4348 pub all_directions_environment: AllDirectionEnvironment,
4449 /// > Only present in info file V2.1 or higher.
···136141 Rotate360 = "360Degree",
137142 Rotate90 = "90Degree",
138143 Legacy = "Legacy",
139139- //Custom types.
144144+ /// > Modded characteristic. May cause problems in un-modded versions of the game.
140145 Lawless = "Lawless",
146146+ /// > Modded characteristic. May cause problems in un-modded versions of the game.
141147 Lightshow = "Lightshow",
142148 }
143149}
···153159 pub name: String,
154160 #[serde(rename = "_difficultyRank")]
155161 pub rank: DifficultyRank,
162162+ /// The path to the difficulty file, relative to the map's folder.
156163 #[serde(rename = "_beatmapFilename")]
157164 pub file: String,
158165 #[doc(alias = "node_jump_speed")]
···162169 #[serde(rename = "_noteJumpStartBeatOffset")]
163170 pub njd: f32,
164171 /// > Only present in info file V2.1 or higher.
172172+ ///
173173+ /// The ID of environment to use from the map's [environment list](Beatmap::environments).
174174+ #[serde(rename = "_environmentNameIdx")]
175175+ pub environment_index: Option<i32>,
176176+ /// > Only present in info file V2.1 or higher.
177177+ ///
178178+ /// The ID of color scheme to use from the map's [color schemes list](Beatmap::color_schemes).
165179 #[serde(rename = "_beatmapColorSchemeIdx")]
166180 pub color_scheme_index: Option<i32>,
167181}
+11-2
src/utils.rs
···11+/// Defines a repr enum that supports any value. If a value does not match any case, it will be parsed as `Unknown`.
12#[macro_export]
23macro_rules! loose_enum {
34 // Special case for strings:
···141142}
142143143144loose_enum! {
145145+ /// An integer repr bool, with 0 being false and 1 being true. Any other value will be saved as `Unknown`.
144146 #[derive(Default, Copy)]
145147 LooseBool: i32 {
146148 #[default]
···150152}
151153152154impl LooseBool {
153153- /// Returns as a bool, with unknown values counting as `false`.
154154- pub fn as_bool(&self) -> bool {
155155+ pub fn is_true(&self) -> bool {
155156 match self {
156157 LooseBool::False => false,
157158 LooseBool::True => true,
159159+ LooseBool::Unknown(_) => false,
160160+ }
161161+ }
162162+163163+ pub fn is_false(&self) -> bool {
164164+ match self {
165165+ LooseBool::False => true,
166166+ LooseBool::True => false,
158167 LooseBool::Unknown(_) => false,
159168 }
160169 }