Skip to content

Commit

Permalink
feat: added method AnyPP::hitresult_priority
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxOhn committed Oct 28, 2023
1 parent 457934f commit 5fd29c2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- __Additions:__
- Added `From<u8>` impl for `GameMode`
- Added the method `AnyPP::hitresult_priority`

# v0.9.5 (2023-09-06)

Expand Down
13 changes: 13 additions & 0 deletions src/pp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,19 @@ impl<'map> AnyPP<'map> {
}
}

/// Specify how hitresults should be generated.
///
/// Defauls to [`HitResultPriority::BestCase`].
#[inline]
pub fn hitresult_priority(self, priority: HitResultPriority) -> Self {
match self {
Self::Osu(o) => Self::Osu(o.hitresult_priority(priority)),
Self::Taiko(t) => Self::Taiko(t.hitresult_priority(priority)),
Self::Catch(_) => self, // FIXME: update when ctb hitresult generation is updated
Self::Mania(m) => Self::Mania(m.hitresult_priority(priority)),
}
}

/// Specify the amount of 300s of a play.
#[inline]
pub fn n300(self, n300: usize) -> Self {
Expand Down

0 comments on commit 5fd29c2

Please sign in to comment.