1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 13:37:51 +08:00

Add AffectsAccuracy extension

This commit is contained in:
smoogipoo 2020-09-25 22:16:14 +09:00
parent 2517fffb7e
commit 4bcc3ca828

View File

@ -100,7 +100,7 @@ namespace osu.Game.Rulesets.Scoring
public static class HitResultExtensions public static class HitResultExtensions
{ {
/// <summary> /// <summary>
/// Whether a <see cref="HitResult"/> affects the combo. /// Whether a <see cref="HitResult"/> increases/decreases the combo, and affects the combo portion of the score.
/// </summary> /// </summary>
public static bool AffectsCombo(this HitResult result) public static bool AffectsCombo(this HitResult result)
{ {
@ -122,12 +122,14 @@ namespace osu.Game.Rulesets.Scoring
} }
/// <summary> /// <summary>
/// Whether a <see cref="HitResult"/> should be counted as combo score. /// Whether a <see cref="HitResult"/> affects the accuracy portion of the score.
/// </summary>
public static bool AffectsAccuracy(this HitResult result)
=> IsScorable(result) && !IsBonus(result);
/// <summary>
/// Whether a <see cref="HitResult"/> should be counted as bonus score.
/// </summary> /// </summary>
/// <remarks>
/// This is not the reciprocal of <see cref="AffectsCombo"/>, as <see cref="HitResult.SmallTickHit"/> and <see cref="HitResult.SmallTickMiss"/> do not affect combo
/// but are still considered as part of the accuracy (not bonus) portion of the score.
/// </remarks>
public static bool IsBonus(this HitResult result) public static bool IsBonus(this HitResult result)
{ {
switch (result) switch (result)