osu: minor adjustments
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
pub struct DifficultyAttributes {
|
||||
pub stars: f32,
|
||||
pub ar: f32,
|
||||
pub od: f32,
|
||||
pub speed_strain: f32,
|
||||
pub aim_strain: f32,
|
||||
pub max_combo: usize,
|
||||
pub n_circles: usize,
|
||||
pub n_spinners: usize,
|
||||
}
|
||||
+14
-5
@@ -1,13 +1,22 @@
|
||||
mod versions;
|
||||
pub use versions::*;
|
||||
|
||||
mod curve;
|
||||
mod difficulty_attributes;
|
||||
mod math_util;
|
||||
mod pp;
|
||||
mod versions;
|
||||
|
||||
pub use difficulty_attributes::DifficultyAttributes;
|
||||
pub use pp::*;
|
||||
pub use versions::*;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct DifficultyAttributes {
|
||||
pub stars: f32,
|
||||
pub ar: f32,
|
||||
pub od: f32,
|
||||
pub speed_strain: f32,
|
||||
pub aim_strain: f32,
|
||||
pub max_combo: usize,
|
||||
pub n_circles: usize,
|
||||
pub n_spinners: usize,
|
||||
}
|
||||
|
||||
const HITWINDOW_OD_MIN: f32 = 80.0;
|
||||
const HITWINDOW_OD_AVG: f32 = 50.0;
|
||||
|
||||
@@ -17,20 +17,19 @@ const OBJECT_RADIUS: f32 = 64.0;
|
||||
const SECTION_LEN: f32 = 400.0;
|
||||
const DIFFICULTY_MULTIPLIER: f32 = 0.0675;
|
||||
|
||||
/// Star calculation for osu!standard maps
|
||||
/// Star calculation for osu!standard maps.
|
||||
///
|
||||
/// Sliders are considered as regular hitcircles and stack leniency is ignored.
|
||||
/// Still very good results but the least precise version in general.
|
||||
/// However, this is the most efficient one.
|
||||
pub fn stars(map: &Beatmap, mods: impl Mods) -> DifficultyAttributes {
|
||||
let attributes = map.attributes().mods(mods);
|
||||
|
||||
if map.hit_objects.len() < 2 {
|
||||
return DifficultyAttributes {
|
||||
stars: 0.0,
|
||||
ar: attributes.ar,
|
||||
od: attributes.od,
|
||||
speed_strain: 0.0,
|
||||
aim_strain: 0.0,
|
||||
max_combo: 0,
|
||||
n_circles: 0,
|
||||
n_spinners: 0,
|
||||
..Default::default()
|
||||
};
|
||||
}
|
||||
|
||||
@@ -322,6 +321,7 @@ mod tests {
|
||||
// .combo(100)
|
||||
// .n100(0)
|
||||
.mods(0);
|
||||
|
||||
let result = calculator.calculate();
|
||||
|
||||
println!("Stars: {}", result.attributes.stars);
|
||||
|
||||
Reference in New Issue
Block a user