1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-22 19:03:21 +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,9 +26,11 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
{ {
if (component is SkinnableTargetComponent targetComponent && targetComponent.Target == SkinnableTarget.MainHUDComponents) if (component is SkinnableTargetComponent targetComponent && targetComponent.Target == SkinnableTarget.MainHUDComponents)
{ {
if (!providesComboCounter || !(Source.GetDrawableComponent(component) is SkinnableTargetComponentsContainer components)) if (!providesComboCounter)
return null; return null;
if (Source.GetDrawableComponent(component) is SkinnableTargetComponentsContainer components)
{
// catch may provide its own combo counter; hide the default. // catch may provide its own combo counter; hide the default.
// todo: this should probably be done in an elegant way. // todo: this should probably be done in an elegant way.
foreach (var legacyComboCounter in components.OfType<LegacyComboCounter>()) foreach (var legacyComboCounter in components.OfType<LegacyComboCounter>())
@ -37,6 +39,9 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
return components; return components;
} }
return null;
}
if (!(component is CatchSkinComponent catchSkinComponent)) if (!(component is CatchSkinComponent catchSkinComponent))
return null; return null;