1use crate::{
2 Beatmap,
3 any::{Difficulty, difficulty::skills::StrainSkill},
4 catch::{convert::prepare_map, difficulty::DifficultyValues},
5 model::mode::ConvertError,
6};
7
8#[derive(Clone, Debug, PartialEq)]
12pub struct CatchStrains {
13 pub movement: Vec<f64>,
15}
16
17impl CatchStrains {
18 pub const SECTION_LEN: f64 = 750.0;
20}
21
22pub fn strains(difficulty: &Difficulty, map: &Beatmap) -> Result<CatchStrains, ConvertError> {
23 let map = prepare_map(difficulty, map)?;
24 let DifficultyValues { movement, .. } = DifficultyValues::calculate(difficulty, &map);
25
26 Ok(CatchStrains {
27 movement: movement.into_current_strain_peaks(),
28 })
29}