From c93ed541f3571aa3d9991949d75f29b74fa46def Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 13 May 2021 13:09:33 +0900 Subject: [PATCH] Add xmldoc and tidy up logic in `Skin` --- osu.Game/Skinning/Skin.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/osu.Game/Skinning/Skin.cs b/osu.Game/Skinning/Skin.cs index 1fb1e3b99f..64c848fbfa 100644 --- a/osu.Game/Skinning/Skin.cs +++ b/osu.Game/Skinning/Skin.cs @@ -61,11 +61,19 @@ protected Skin(SkinInfo skin, IStorageResourceProvider resources) } } + /// + /// Remove all stored customisations for the provided target. + /// + /// The target container to reset. public void ResetDrawableTarget(SkinnableElementTargetContainer targetContainer) { DrawableComponentInfo.Remove(targetContainer.Target); } + /// + /// Update serialised information for the provided target. + /// + /// The target container to serialise to this skin. public void UpdateDrawableTarget(SkinnableElementTargetContainer targetContainer) { DrawableComponentInfo[targetContainer.Target] = targetContainer.CreateSerialisedChildren().ToArray(); @@ -76,10 +84,7 @@ public virtual Drawable GetDrawableComponent(ISkinComponent component) switch (component) { case SkinnableTargetComponent target: - - var skinnableTarget = target.Target; - - if (!DrawableComponentInfo.TryGetValue(skinnableTarget, out var skinnableInfo)) + if (!DrawableComponentInfo.TryGetValue(target.Target, out var skinnableInfo)) return null; return new SkinnableTargetWrapper