mirror of https://github.com/ppy/osu
Add xmldoc and tidy up logic in `Skin`
This commit is contained in:
parent
992a052426
commit
c93ed541f3
|
@ -61,11 +61,19 @@ protected Skin(SkinInfo skin, IStorageResourceProvider resources)
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove all stored customisations for the provided target.
|
||||
/// </summary>
|
||||
/// <param name="targetContainer">The target container to reset.</param>
|
||||
public void ResetDrawableTarget(SkinnableElementTargetContainer targetContainer)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue