mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Separate increase/break combo helper methods from AffectsCombo
This commit is contained in:
@ -122,19 +122,33 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
public static class HitResultExtensions
|
public static class HitResultExtensions
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether a <see cref="HitResult"/> increases/decreases the combo, and affects the combo portion of the score.
|
/// Whether a <see cref="HitResult"/> increases the combo.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool AffectsCombo(this HitResult result)
|
public static bool IncreasesCombo(this HitResult result)
|
||||||
{
|
{
|
||||||
switch (result)
|
switch (result)
|
||||||
{
|
{
|
||||||
case HitResult.Miss:
|
|
||||||
case HitResult.Meh:
|
case HitResult.Meh:
|
||||||
case HitResult.Ok:
|
case HitResult.Ok:
|
||||||
case HitResult.Good:
|
case HitResult.Good:
|
||||||
case HitResult.Great:
|
case HitResult.Great:
|
||||||
case HitResult.Perfect:
|
case HitResult.Perfect:
|
||||||
case HitResult.LargeTickHit:
|
case HitResult.LargeTickHit:
|
||||||
|
return true;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether a <see cref="HitResult"/> breaks the combo and resets it back to zero.
|
||||||
|
/// </summary>
|
||||||
|
public static bool BreaksCombo(this HitResult result)
|
||||||
|
{
|
||||||
|
switch (result)
|
||||||
|
{
|
||||||
|
case HitResult.Miss:
|
||||||
case HitResult.LargeTickMiss:
|
case HitResult.LargeTickMiss:
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@ -143,6 +157,12 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether a <see cref="HitResult"/> increases/breaks the combo, and affects the combo portion of the score.
|
||||||
|
/// </summary>
|
||||||
|
public static bool AffectsCombo(this HitResult result)
|
||||||
|
=> IncreasesCombo(result) || BreaksCombo(result);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether a <see cref="HitResult"/> affects the accuracy portion of the score.
|
/// Whether a <see cref="HitResult"/> affects the accuracy portion of the score.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Reference in New Issue
Block a user