feat: compact strains (#32)

* store zero strains compactly

* added docs

* added proptest

* add feature to store strains compactly

* update ci

* rename CompactZerosVec to StrainsVec

* add size_hint for iter

* rename iter

* minor adjustments

* more minor adjustments
This commit is contained in:
Badewanne3
2024-03-31 11:49:29 +02:00
committed by GitHub
parent 279e04cc1e
commit a577200a0f
22 changed files with 552 additions and 84 deletions
+2 -1
View File
@@ -4,6 +4,7 @@ use crate::{
skills::{strain_decay, ISkill, Skill, StrainDecaySkill},
},
catch::difficulty::object::CatchDifficultyObject,
util::strains_vec::StrainsVec,
};
const ABSOLUTE_PLAYER_POSITIONING_ERROR: f32 = 16.0;
@@ -107,7 +108,7 @@ impl Movement {
dist_addition / weighted_strain_time
}
pub fn get_curr_strain_peaks(self) -> Vec<f64> {
pub fn get_curr_strain_peaks(self) -> StrainsVec {
self.inner.get_curr_strain_peaks()
}
+1 -1
View File
@@ -20,6 +20,6 @@ pub fn strains(difficulty: &Difficulty, converted: &CatchBeatmap<'_>) -> CatchSt
let DifficultyValues { movement, .. } = DifficultyValues::calculate(difficulty, converted);
CatchStrains {
movement: movement.get_curr_strain_peaks(),
movement: movement.get_curr_strain_peaks().into_vec(),
}
}