2019-04-25 08:36:17 +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.
|
|
|
|
|
|
|
|
using osu.Framework.Audio.Sample;
|
2019-09-03 08:57:34 +00:00
|
|
|
using osu.Framework.Bindables;
|
2019-04-25 08:36:17 +00:00
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Textures;
|
2019-08-23 11:32:43 +00:00
|
|
|
using osu.Game.Audio;
|
2019-04-25 08:36:17 +00:00
|
|
|
|
|
|
|
namespace osu.Game.Skinning
|
|
|
|
{
|
|
|
|
/// <summary>
|
2023-02-15 06:14:38 +00:00
|
|
|
/// Provides access to various elements contained by a skin.
|
2019-04-25 08:36:17 +00:00
|
|
|
/// </summary>
|
|
|
|
public interface ISkin
|
|
|
|
{
|
2019-09-03 09:30:22 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Retrieve a <see cref="Drawable"/> component implementation.
|
|
|
|
/// </summary>
|
2022-11-09 05:11:41 +00:00
|
|
|
/// <param name="lookup">The requested component.</param>
|
2019-09-03 09:30:22 +00:00
|
|
|
/// <returns>A drawable representation for the requested component, or null if unavailable.</returns>
|
2022-11-09 07:04:56 +00:00
|
|
|
Drawable? GetDrawableComponent(ISkinComponentLookup lookup);
|
2019-04-25 08:36:17 +00:00
|
|
|
|
2019-09-03 09:30:22 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Retrieve a <see cref="Texture"/>.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="componentName">The requested texture.</param>
|
|
|
|
/// <returns>A matching texture, or null if unavailable.</returns>
|
2022-03-23 15:08:01 +00:00
|
|
|
Texture? GetTexture(string componentName) => GetTexture(componentName, default, default);
|
2020-07-17 07:54:30 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Retrieve a <see cref="Texture"/>.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="componentName">The requested texture.</param>
|
|
|
|
/// <param name="wrapModeS">The texture wrap mode in horizontal direction.</param>
|
|
|
|
/// <param name="wrapModeT">The texture wrap mode in vertical direction.</param>
|
|
|
|
/// <returns>A matching texture, or null if unavailable.</returns>
|
2022-03-23 15:08:01 +00:00
|
|
|
Texture? GetTexture(string componentName, WrapMode wrapModeS, WrapMode wrapModeT);
|
2019-04-25 08:36:17 +00:00
|
|
|
|
2019-09-03 09:30:22 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Retrieve a <see cref="SampleChannel"/>.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="sampleInfo">The requested sample.</param>
|
|
|
|
/// <returns>A matching sample channel, or null if unavailable.</returns>
|
2022-03-23 15:08:01 +00:00
|
|
|
ISample? GetSample(ISampleInfo sampleInfo);
|
2019-04-25 08:36:17 +00:00
|
|
|
|
2019-09-03 09:30:22 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Retrieve a configuration value.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="lookup">The requested configuration value.</param>
|
|
|
|
/// <returns>A matching value boxed in an <see cref="IBindable{TValue}"/>, or null if unavailable.</returns>
|
2022-03-25 06:53:55 +00:00
|
|
|
IBindable<TValue>? GetConfig<TLookup, TValue>(TLookup lookup)
|
|
|
|
where TLookup : notnull
|
|
|
|
where TValue : notnull;
|
2019-04-25 08:36:17 +00:00
|
|
|
}
|
|
|
|
}
|