Add AffectsAccuracy extension

This commit is contained in:
smoogipoo 2020-09-25 22:16:14 +09:00
parent 2517fffb7e
commit 4bcc3ca828
1 changed files with 8 additions and 6 deletions

View File

@ -100,7 +100,7 @@ public enum HitResult
public static class HitResultExtensions
{
/// <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>
public static bool AffectsCombo(this HitResult result)
{
@ -122,12 +122,14 @@ public static bool AffectsCombo(this HitResult result)
}
/// <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>
/// <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)
{
switch (result)