Rename ISkinComponent to ISkinLookup

This commit is contained in:
Dean Herbert
2022-11-09 14:11:41 +09:00
parent ab458320c4
commit c908969d9b
90 changed files with 224 additions and 213 deletions

View File

@ -5,9 +5,9 @@ using osu.Game.Skinning;
namespace osu.Game.Rulesets.Catch
{
public class CatchSkinComponent : GameplaySkinComponent<CatchSkinComponents>
public class CatchSkinLookup : GameplaySkinLookup<CatchSkinComponents>
{
public CatchSkinComponent(CatchSkinComponents component)
public CatchSkinLookup(CatchSkinComponents component)
: base(component)
{
}

View File

@ -37,8 +37,8 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
public override bool RemoveWhenNotAlive => true;
protected CaughtObject(CatchSkinComponents skinComponent, Func<ISkinComponent, Drawable> defaultImplementation)
: base(new CatchSkinComponent(skinComponent), defaultImplementation)
protected CaughtObject(CatchSkinComponents skinComponent, Func<ISkinLookup, Drawable> defaultImplementation)
: base(new CatchSkinLookup(skinComponent), defaultImplementation)
{
Origin = Anchor.Centre;

View File

@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
private void load()
{
ScalingContainer.Child = new SkinnableDrawable(
new CatchSkinComponent(CatchSkinComponents.Banana),
new CatchSkinLookup(CatchSkinComponents.Banana),
_ => new BananaPiece());
}

View File

@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
private void load()
{
ScalingContainer.Child = new SkinnableDrawable(
new CatchSkinComponent(CatchSkinComponents.Droplet),
new CatchSkinLookup(CatchSkinComponents.Droplet),
_ => new DropletPiece());
}

View File

@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
private void load()
{
ScalingContainer.Child = new SkinnableDrawable(
new CatchSkinComponent(CatchSkinComponents.Fruit),
new CatchSkinLookup(CatchSkinComponents.Fruit),
_ => new FruitPiece());
}

View File

@ -13,11 +13,11 @@ namespace osu.Game.Rulesets.Catch.Skinning.Argon
{
}
public override Drawable? GetDrawableComponent(ISkinComponent component)
public override Drawable? GetDrawableComponent(ISkinLookup lookup)
{
switch (component)
switch (lookup)
{
case CatchSkinComponent catchComponent:
case CatchSkinLookup catchComponent:
// TODO: Once everything is finalised, consider throwing UnsupportedSkinComponentException on missing entries.
switch (catchComponent.Component)
{
@ -40,7 +40,7 @@ namespace osu.Game.Rulesets.Catch.Skinning.Argon
break;
}
return base.GetDrawableComponent(component);
return base.GetDrawableComponent(lookup);
}
}
}

View File

@ -25,14 +25,14 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
{
}
public override Drawable? GetDrawableComponent(ISkinComponent component)
public override Drawable? GetDrawableComponent(ISkinLookup lookup)
{
if (component is SkinnableTargetComponent targetComponent)
if (lookup is SkinnableTargetLookup targetComponent)
{
switch (targetComponent.Target)
{
case SkinnableTarget.MainHUDComponents:
var components = base.GetDrawableComponent(component) as SkinnableTargetComponentsContainer;
var components = base.GetDrawableComponent(lookup) as SkinnableTargetComponentsContainer;
if (providesComboCounter && components != null)
{
@ -46,7 +46,7 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
}
}
if (component is CatchSkinComponent catchSkinComponent)
if (lookup is CatchSkinLookup catchSkinComponent)
{
switch (catchSkinComponent.Component)
{
@ -95,11 +95,11 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
return null;
default:
throw new UnsupportedSkinComponentException(component);
throw new UnsupportedSkinComponentException(lookup);
}
}
return base.GetDrawableComponent(component);
return base.GetDrawableComponent(lookup);
}
private bool hasOldStyleCatcherSprite() =>
@ -127,7 +127,7 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
{
case CatchSkinConfiguration.FlipCatcherPlate:
// Don't flip catcher plate contents if the catcher is provided by this legacy skin.
if (GetDrawableComponent(new CatchSkinComponent(CatchSkinComponents.Catcher)) != null)
if (GetDrawableComponent(new CatchSkinLookup(CatchSkinComponents.Catcher)) != null)
return (IBindable<TValue>)new Bindable<bool>();
break;

View File

@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.Catch.UI
private readonly IBindable<bool> showCombo = new BindableBool(true);
public CatchComboDisplay()
: base(new CatchSkinComponent(CatchSkinComponents.CatchComboCounter), _ => Empty())
: base(new CatchSkinLookup(CatchSkinComponents.CatchComboCounter), _ => Empty())
{
}

View File

@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Catch.UI
Anchor = Anchor.BottomCentre;
Origin = Anchor.BottomCentre;
InternalChild = skinnableExplosion = new SkinnableDrawable(new CatchSkinComponent(CatchSkinComponents.HitExplosion), _ => new DefaultHitExplosion())
InternalChild = skinnableExplosion = new SkinnableDrawable(new CatchSkinLookup(CatchSkinComponents.HitExplosion), _ => new DefaultHitExplosion())
{
CentreComponent = false,
Anchor = Anchor.BottomCentre,

View File

@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.Catch.UI
public readonly Bindable<CatcherAnimationState> AnimationState = new Bindable<CatcherAnimationState>();
public SkinnableCatcher()
: base(new CatchSkinComponent(CatchSkinComponents.Catcher), _ => new DefaultCatcher())
: base(new CatchSkinLookup(CatchSkinComponents.Catcher), _ => new DefaultCatcher())
{
Anchor = Anchor.TopCentre;
// Sets the origin roughly to the centre of the catcher's plate to allow for correct scaling.