1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-20 16:12:54 +08:00

Improve code readability

This commit is contained in:
Salman Ahmed 2021-05-17 11:41:53 +03:00
parent f00799cc64
commit df248ea41b

View File

@ -26,15 +26,20 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
{
if (component is SkinnableTargetComponent targetComponent && targetComponent.Target == SkinnableTarget.MainHUDComponents)
{
if (!providesComboCounter || !(Source.GetDrawableComponent(component) is SkinnableTargetComponentsContainer components))
if (!providesComboCounter)
return null;
// catch may provide its own combo counter; hide the default.
// todo: this should probably be done in an elegant way.
foreach (var legacyComboCounter in components.OfType<LegacyComboCounter>())
legacyComboCounter.Expire();
if (Source.GetDrawableComponent(component) is SkinnableTargetComponentsContainer components)
{
// catch may provide its own combo counter; hide the default.
// todo: this should probably be done in an elegant way.
foreach (var legacyComboCounter in components.OfType<LegacyComboCounter>())
legacyComboCounter.Expire();
return components;
return components;
}
return null;
}
if (!(component is CatchSkinComponent catchSkinComponent))