mirror of
https://github.com/ppy/osu
synced 2024-12-16 11:56:31 +00:00
Use switch statement for type matching
This commit is contained in:
parent
a556caae43
commit
2ab84fdaa3
@ -99,15 +99,21 @@ namespace osu.Game.Rulesets.Osu.Scoring
|
||||
double hpOverkill = Math.Max(0, hpReduction - currentHp);
|
||||
reduceHp(hpReduction);
|
||||
|
||||
if (h is Slider slider)
|
||||
switch (h)
|
||||
{
|
||||
foreach (var nested in slider.NestedHitObjects)
|
||||
increaseHp(nested);
|
||||
}
|
||||
else if (h is Spinner spinner)
|
||||
{
|
||||
foreach (var nested in spinner.NestedHitObjects.Where(t => t is not SpinnerBonusTick))
|
||||
increaseHp(nested);
|
||||
case Slider slider:
|
||||
{
|
||||
foreach (var nested in slider.NestedHitObjects)
|
||||
increaseHp(nested);
|
||||
break;
|
||||
}
|
||||
|
||||
case Spinner spinner:
|
||||
{
|
||||
foreach (var nested in spinner.NestedHitObjects.Where(t => t is not SpinnerBonusTick))
|
||||
increaseHp(nested);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Note: Because HP is capped during the above increases, long sliders (with many ticks) or spinners
|
||||
|
Loading…
Reference in New Issue
Block a user