Skip to content

Commit

Permalink
add GradualPerformance::len methods
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxOhn committed Mar 11, 2024
1 parent c73976c commit 9019632
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/any/performance/gradual.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 5 additions & 0 deletions src/catch/performance/gradual.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ impl CatchGradualPerformance {

Some(performance)
}

/// Returns the amount of remaining objects.
pub fn len(&self) -> usize {
self.difficulty.len()
}
}

#[cfg(test)]
Expand Down
5 changes: 5 additions & 0 deletions src/mania/performance/gradual.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ impl ManiaGradualPerformance {

Some(performance)
}

/// Returns the amount of remaining objects.
pub fn len(&self) -> usize {
self.difficulty.len()
}
}

#[cfg(test)]
Expand Down
5 changes: 5 additions & 0 deletions src/osu/performance/gradual.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ impl OsuGradualPerformance {

Some(performance)
}

/// Returns the amount of remaining objects.
pub fn len(&self) -> usize {
self.difficulty.len()
}
}

#[cfg(test)]
Expand Down
5 changes: 5 additions & 0 deletions src/taiko/performance/gradual.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ impl TaikoGradualPerformance {

Some(performance)
}

/// Returns the amount of remaining objects.
pub fn len(&self) -> usize {
self.difficulty.len()
}
}

#[cfg(test)]
Expand Down

0 comments on commit 9019632

Please sign in to comment.