1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-22 16:03:21 +08:00

Use switch for pattern matching

This commit is contained in:
Dean Herbert 2021-07-13 19:37:02 +09:00
parent db8ffc6316
commit 6b663037e4

View File

@ -70,13 +70,15 @@ namespace osu.Game.Rulesets.Osu.Mods
// Move hit objects back into the playfield if they are outside of it // Move hit objects back into the playfield if they are outside of it
Vector2 shift = Vector2.Zero; Vector2 shift = Vector2.Zero;
if (hitObject is HitCircle circle) switch (hitObject)
{ {
shift = clampHitCircleToPlayfield(circle, current); case HitCircle circle:
} shift = clampHitCircleToPlayfield(circle, current);
else if (hitObject is Slider slider) break;
{
shift = clampSliderToPlayfield(slider, current); case Slider slider:
shift = clampSliderToPlayfield(slider, current);
break;
} }
if (shift != Vector2.Zero) if (shift != Vector2.Zero)