add GradualPerformance::len methods
This commit is contained in:
@@ -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(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,6 +128,11 @@ impl CatchGradualPerformance {
|
||||
|
||||
Some(performance)
|
||||
}
|
||||
|
||||
/// Returns the amount of remaining objects.
|
||||
pub fn len(&self) -> usize {
|
||||
self.difficulty.len()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -110,6 +110,11 @@ impl ManiaGradualPerformance {
|
||||
|
||||
Some(performance)
|
||||
}
|
||||
|
||||
/// Returns the amount of remaining objects.
|
||||
pub fn len(&self) -> usize {
|
||||
self.difficulty.len()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -120,6 +120,11 @@ impl OsuGradualPerformance {
|
||||
|
||||
Some(performance)
|
||||
}
|
||||
|
||||
/// Returns the amount of remaining objects.
|
||||
pub fn len(&self) -> usize {
|
||||
self.difficulty.len()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -119,6 +119,11 @@ impl TaikoGradualPerformance {
|
||||
|
||||
Some(performance)
|
||||
}
|
||||
|
||||
/// Returns the amount of remaining objects.
|
||||
pub fn len(&self) -> usize {
|
||||
self.difficulty.len()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user