2021-04-30 11:41:18 +08: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 16:25:51 +08:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
2021-05-12 14:58:21 +08:00
|
|
|
using osu.Framework.Bindables;
|
2021-05-12 13:11:40 +08:00
|
|
|
using osu.Framework.Graphics;
|
2021-05-13 16:25:51 +08:00
|
|
|
using osu.Game.Extensions;
|
|
|
|
using osu.Game.Screens.Play.HUD;
|
2021-05-12 13:11:40 +08:00
|
|
|
|
2021-04-30 11:42:32 +08:00
|
|
|
namespace osu.Game.Skinning
|
2021-04-30 11:41:18 +08:00
|
|
|
{
|
|
|
|
/// <summary>
|
2021-05-13 16:06:00 +08:00
|
|
|
/// Denotes a container which can house <see cref="ISkinnableDrawable"/>s.
|
2021-04-30 11:41:18 +08:00
|
|
|
/// </summary>
|
2021-05-12 13:11:40 +08:00
|
|
|
public interface ISkinnableTarget : IDrawable
|
2021-04-30 11:41:18 +08:00
|
|
|
{
|
2021-05-12 14:58:21 +08: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 16:06:00 +08:00
|
|
|
IBindableList<ISkinnableDrawable> Components { get; }
|
2021-05-11 10:56:14 +08:00
|
|
|
|
2021-05-13 16:25:51 +08: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 10:56:14 +08:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Reload this target from the current skin.
|
|
|
|
/// </summary>
|
2021-05-12 14:58:21 +08:00
|
|
|
void Reload();
|
2021-05-11 10:56:14 +08:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Add the provided item to this target.
|
|
|
|
/// </summary>
|
2021-05-13 16:06:00 +08:00
|
|
|
void Add(ISkinnableDrawable drawable);
|
2021-04-30 11:41:18 +08:00
|
|
|
}
|
|
|
|
}
|