1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-13 15:27:30 +08:00

Rename GameplaySkinComponentLookup -> SkinComponentLookup

This commit is contained in:
Dean Herbert 2024-08-22 18:42:38 +09:00
parent f37cab0c6e
commit 36b4013fa6
No known key found for this signature in database
15 changed files with 35 additions and 41 deletions

View File

@ -5,7 +5,7 @@ using osu.Game.Skinning;
namespace osu.Game.Rulesets.Catch
{
public class CatchSkinComponentLookup : GameplaySkinComponentLookup<CatchSkinComponents>
public class CatchSkinComponentLookup : SkinComponentLookup<CatchSkinComponents>
{
public CatchSkinComponentLookup(CatchSkinComponents component)
: base(component)

View File

@ -5,7 +5,7 @@ using osu.Game.Skinning;
namespace osu.Game.Rulesets.Mania
{
public class ManiaSkinComponentLookup : GameplaySkinComponentLookup<ManiaSkinComponents>
public class ManiaSkinComponentLookup : SkinComponentLookup<ManiaSkinComponents>
{
/// <summary>
/// Creates a new <see cref="ManiaSkinComponentLookup"/>.

View File

@ -59,7 +59,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon
return null;
case GameplaySkinComponentLookup<HitResult> resultComponent:
case SkinComponentLookup<HitResult> resultComponent:
// This should eventually be moved to a skin setting, when supported.
if (Skin is ArgonProSkin && resultComponent.Component >= HitResult.Great)
return Drawable.Empty();

View File

@ -114,7 +114,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
return null;
case GameplaySkinComponentLookup<HitResult> resultComponent:
case SkinComponentLookup<HitResult> resultComponent:
return getResult(resultComponent.Component);
case ManiaSkinComponentLookup maniaComponent:

View File

@ -5,7 +5,7 @@ using osu.Game.Skinning;
namespace osu.Game.Rulesets.Osu
{
public class OsuSkinComponentLookup : GameplaySkinComponentLookup<OsuSkinComponents>
public class OsuSkinComponentLookup : SkinComponentLookup<OsuSkinComponents>
{
public OsuSkinComponentLookup(OsuSkinComponents component)
: base(component)

View File

@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
{
switch (lookup)
{
case GameplaySkinComponentLookup<HitResult> resultComponent:
case SkinComponentLookup<HitResult> resultComponent:
HitResult result = resultComponent.Component;
// This should eventually be moved to a skin setting, when supported.

View File

@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
{
switch (lookup)
{
case GameplaySkinComponentLookup<HitResult> resultComponent:
case SkinComponentLookup<HitResult> resultComponent:
HitResult result = resultComponent.Component;
switch (result)

View File

@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Argon
{
switch (lookup)
{
case GameplaySkinComponentLookup<HitResult> resultComponent:
case SkinComponentLookup<HitResult> resultComponent:
// This should eventually be moved to a skin setting, when supported.
if (Skin is ArgonProSkin && resultComponent.Component >= HitResult.Great)
return Drawable.Empty();

View File

@ -29,7 +29,7 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Legacy
public override Drawable? GetDrawableComponent(ISkinComponentLookup lookup)
{
if (lookup is GameplaySkinComponentLookup<HitResult>)
if (lookup is SkinComponentLookup<HitResult>)
{
// if a taiko skin is providing explosion sprites, hide the judgements completely
if (hasExplosion.Value)

View File

@ -5,7 +5,7 @@ using osu.Game.Skinning;
namespace osu.Game.Rulesets.Taiko
{
public class TaikoSkinComponentLookup : GameplaySkinComponentLookup<TaikoSkinComponents>
public class TaikoSkinComponentLookup : SkinComponentLookup<TaikoSkinComponents>
{
public TaikoSkinComponentLookup(TaikoSkinComponents component)
: base(component)

View File

@ -163,7 +163,7 @@ namespace osu.Game.Rulesets.Judgements
if (JudgementBody != null)
RemoveInternal(JudgementBody, true);
AddInternal(JudgementBody = new SkinnableDrawable(new GameplaySkinComponentLookup<HitResult>(type), _ =>
AddInternal(JudgementBody = new SkinnableDrawable(new SkinComponentLookup<HitResult>(type), _ =>
CreateDefaultJudgement(type), confineMode: ConfineMode.NoScaling));
JudgementBody.OnSkinChanged += () =>

View File

@ -1,28 +0,0 @@
// 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 System;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Scoring;
namespace osu.Game.Skinning
{
/// <summary>
/// A lookup type intended for use for skinnable gameplay components (not HUD level components).
/// </summary>
/// <remarks>
/// The most common usage of this class is for ruleset-specific skinning implementations, but it can also be used directly
/// (see <see cref="DrawableJudgement"/>'s usage for <see cref="HitResult"/>) where ruleset-agnostic elements are required.
/// </remarks>
/// <typeparam name="T">An enum lookup type.</typeparam>
public class GameplaySkinComponentLookup<T> : ISkinComponentLookup
where T : Enum
{
public readonly T Component;
public GameplaySkinComponentLookup(T component)
{
Component = component;
}
}
}

View File

@ -12,7 +12,7 @@ namespace osu.Game.Skinning
/// to scope particular lookup variations. Using this, a ruleset or skin implementation could make its own lookup
/// type to scope away from more global contexts.
///
/// More commonly, a ruleset could make use of <see cref="GameplaySkinComponentLookup{T}"/> to do a simple lookup based on
/// More commonly, a ruleset could make use of <see cref="SkinComponentLookup{T}"/> to do a simple lookup based on
/// a provided enum.
/// </remarks>
public interface ISkinComponentLookup

View File

@ -426,7 +426,7 @@ namespace osu.Game.Skinning
return null;
case GameplaySkinComponentLookup<HitResult> resultComponent:
case SkinComponentLookup<HitResult> resultComponent:
// kind of wasteful that we throw this away, but should do for now.
if (getJudgementAnimation(resultComponent.Component) != null)

View File

@ -0,0 +1,22 @@
// 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 System;
namespace osu.Game.Skinning
{
/// <summary>
/// A lookup type intended for use for skinnable components.
/// </summary>
/// <typeparam name="T">An enum lookup type.</typeparam>
public class SkinComponentLookup<T> : ISkinComponentLookup
where T : Enum
{
public readonly T Component;
public SkinComponentLookup(T component)
{
Component = component;
}
}
}