mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 15:07:44 +08:00
Convert switch expression to switch statement
This commit is contained in:
parent
604619ba47
commit
d1076778fd
@ -127,14 +127,23 @@ namespace osu.Game.Rulesets.Catch.UI
|
||||
|
||||
private DrawableCatchHitObject createCaughtFruit(DrawablePalpableCatchHitObject hitObject)
|
||||
{
|
||||
return hitObject.HitObject switch
|
||||
switch (hitObject.HitObject)
|
||||
{
|
||||
Banana banana => new DrawableBanana(banana),
|
||||
Fruit fruit => new DrawableFruit(fruit),
|
||||
TinyDroplet tiny => new DrawableTinyDroplet(tiny),
|
||||
Droplet droplet => new DrawableDroplet(droplet),
|
||||
_ => null
|
||||
};
|
||||
case Banana banana:
|
||||
return new DrawableBanana(banana);
|
||||
|
||||
case Fruit fruit:
|
||||
return new DrawableFruit(fruit);
|
||||
|
||||
case TinyDroplet tiny:
|
||||
return new DrawableTinyDroplet(tiny);
|
||||
|
||||
case Droplet droplet:
|
||||
return new DrawableDroplet(droplet);
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user