1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 17:35:10 +08:00

Add xmldoc and tidy up logic in Skin

This commit is contained in:
Dean Herbert 2021-05-13 13:09:33 +09:00
parent 992a052426
commit c93ed541f3

View File

@ -61,11 +61,19 @@ namespace osu.Game.Skinning
} }
} }
/// <summary>
/// Remove all stored customisations for the provided target.
/// </summary>
/// <param name="targetContainer">The target container to reset.</param>
public void ResetDrawableTarget(SkinnableElementTargetContainer targetContainer) public void ResetDrawableTarget(SkinnableElementTargetContainer targetContainer)
{ {
DrawableComponentInfo.Remove(targetContainer.Target); DrawableComponentInfo.Remove(targetContainer.Target);
} }
/// <summary>
/// Update serialised information for the provided target.
/// </summary>
/// <param name="targetContainer">The target container to serialise to this skin.</param>
public void UpdateDrawableTarget(SkinnableElementTargetContainer targetContainer) public void UpdateDrawableTarget(SkinnableElementTargetContainer targetContainer)
{ {
DrawableComponentInfo[targetContainer.Target] = targetContainer.CreateSerialisedChildren().ToArray(); DrawableComponentInfo[targetContainer.Target] = targetContainer.CreateSerialisedChildren().ToArray();
@ -76,10 +84,7 @@ namespace osu.Game.Skinning
switch (component) switch (component)
{ {
case SkinnableTargetComponent target: case SkinnableTargetComponent target:
if (!DrawableComponentInfo.TryGetValue(target.Target, out var skinnableInfo))
var skinnableTarget = target.Target;
if (!DrawableComponentInfo.TryGetValue(skinnableTarget, out var skinnableInfo))
return null; return null;
return new SkinnableTargetWrapper return new SkinnableTargetWrapper