2021-04-30 03:41:18 +00:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
2021-05-13 08:25:51 +00:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
2021-05-12 06:58:21 +00:00
|
|
|
using osu.Framework.Bindables;
|
2021-05-12 05:11:40 +00:00
|
|
|
using osu.Framework.Graphics;
|
2021-05-13 08:25:51 +00:00
|
|
|
using osu.Game.Extensions;
|
|
|
|
using osu.Game.Screens.Play.HUD;
|
2021-05-12 05:11:40 +00:00
|
|
|
|
2021-04-30 03:42:32 +00:00
|
|
|
namespace osu.Game.Skinning
|
2021-04-30 03:41:18 +00:00
|
|
|
{
|
|
|
|
/// <summary>
|
2021-05-13 08:06:00 +00:00
|
|
|
/// Denotes a container which can house <see cref="ISkinnableDrawable"/>s.
|
2021-04-30 03:41:18 +00:00
|
|
|
/// </summary>
|
2021-05-12 05:11:40 +00:00
|
|
|
public interface ISkinnableTarget : IDrawable
|
2021-04-30 03:41:18 +00:00
|
|
|
{
|
2021-05-12 06:58:21 +00:00
|
|
|
/// <summary>
|
|
|
|
/// The definition of this target.
|
|
|
|
/// </summary>
|
|
|
|
SkinnableTarget Target { get; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// A bindable list of components which are being tracked by this skinnable target.
|
|
|
|
/// </summary>
|
2021-05-13 08:06:00 +00:00
|
|
|
IBindableList<ISkinnableDrawable> Components { get; }
|
2021-05-11 02:56:14 +00:00
|
|
|
|
2021-05-13 08:25:51 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Serialise all children as <see cref="SkinnableInfo"/>.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>The serialised content.</returns>
|
|
|
|
IEnumerable<SkinnableInfo> CreateSkinnableInfo() => Components.Select(d => ((Drawable)d).CreateSkinnableInfo());
|
2021-05-11 02:56:14 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Reload this target from the current skin.
|
|
|
|
/// </summary>
|
2021-05-12 06:58:21 +00:00
|
|
|
void Reload();
|
2021-05-11 02:56:14 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2021-05-14 07:03:22 +00:00
|
|
|
/// Add a new skinnable component to this target.
|
2021-05-11 02:56:14 +00:00
|
|
|
/// </summary>
|
2021-05-14 07:03:22 +00:00
|
|
|
/// <param name="drawable">The component to add.</param>
|
2021-05-13 08:06:00 +00:00
|
|
|
void Add(ISkinnableDrawable drawable);
|
2021-05-14 07:03:22 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2021-05-14 20:15:43 +00:00
|
|
|
/// Remove an existing skinnable component from this target.
|
2021-05-14 07:03:22 +00:00
|
|
|
/// </summary>
|
2021-05-14 20:15:43 +00:00
|
|
|
/// <param name="component">The component to remove.</param>
|
2021-05-14 07:03:22 +00:00
|
|
|
public void Remove(ISkinnableDrawable component);
|
2021-04-30 03:41:18 +00:00
|
|
|
}
|
|
|
|
}
|