added TaikoGradualDifficultyAttributes

This commit is contained in:
MaxOhn
2021-11-24 02:21:48 +01:00
parent e0521ba03e
commit 9d02a5cc48
7 changed files with 515 additions and 86 deletions
+7 -11
View File
@@ -105,15 +105,12 @@ impl Iterator for ManiaGradualDifficultyAttributes<'_> {
if self.idx == 2 {
self.curr_section_end = (h.start_time / SECTION_LEN).ceil() * SECTION_LEN;
self.strain.process(&h);
return Some(ManiaDifficultyAttributes::default());
}
while h.start_time > self.curr_section_end {
self.strain.save_current_peak();
self.strain.start_new_section_from(self.curr_section_end);
self.curr_section_end += SECTION_LEN;
} else {
while h.start_time > self.curr_section_end {
self.strain.save_current_peak();
self.strain.start_new_section_from(self.curr_section_end);
self.curr_section_end += SECTION_LEN;
}
}
self.strain.process(&h);
@@ -135,8 +132,7 @@ impl Iterator for ManiaGradualDifficultyAttributes<'_> {
#[inline]
fn size_hint(&self) -> (usize, Option<usize>) {
let (mut len, _) = self.difficulty_objects.size_hint();
len += (self.idx == 0) as usize;
let len = self.len();
(len, Some(len))
}