add GradualPerformance::len methods

This commit is contained in:
MaxOhn
2024-03-11 17:58:40 +01:00
parent c73976cf8a
commit 90196329c1
5 changed files with 30 additions and 0 deletions
+10
View File
@@ -166,4 +166,14 @@ impl GradualPerformance {
.map(PerformanceAttributes::Mania),
}
}
/// Returns the amount of remaining objects.
pub fn len(&self) -> usize {
match self {
GradualPerformance::Osu(gradual) => gradual.len(),
GradualPerformance::Taiko(gradual) => gradual.len(),
GradualPerformance::Catch(gradual) => gradual.len(),
GradualPerformance::Mania(gradual) => gradual.len(),
}
}
}
+5
View File
@@ -128,6 +128,11 @@ impl CatchGradualPerformance {
Some(performance)
}
/// Returns the amount of remaining objects.
pub fn len(&self) -> usize {
self.difficulty.len()
}
}
#[cfg(test)]
+5
View File
@@ -110,6 +110,11 @@ impl ManiaGradualPerformance {
Some(performance)
}
/// Returns the amount of remaining objects.
pub fn len(&self) -> usize {
self.difficulty.len()
}
}
#[cfg(test)]
+5
View File
@@ -120,6 +120,11 @@ impl OsuGradualPerformance {
Some(performance)
}
/// Returns the amount of remaining objects.
pub fn len(&self) -> usize {
self.difficulty.len()
}
}
#[cfg(test)]
+5
View File
@@ -119,6 +119,11 @@ impl TaikoGradualPerformance {
Some(performance)
}
/// Returns the amount of remaining objects.
pub fn len(&self) -> usize {
self.difficulty.len()
}
}
#[cfg(test)]