1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 14:12:54 +08:00

Rename facade + cleanup usage

This commit is contained in:
smoogipoo 2019-04-17 16:41:20 +09:00
parent 3a1587fa53
commit 4106da2430

View File

@ -15,22 +15,19 @@ namespace osu.Game.Graphics.Containers
/// </summary> /// </summary>
public class LogoTrackingContainer : Container public class LogoTrackingContainer : Container
{ {
public Facade LogoFacade { get; } public Facade LogoFacade => facade;
protected OsuLogo Logo { get; private set; } protected OsuLogo Logo { get; private set; }
private readonly InternalFacade facade = new InternalFacade();
private Easing easing; private Easing easing;
private Vector2? startPosition; private Vector2? startPosition;
private double? startTime; private double? startTime;
private double duration; private double duration;
public LogoTrackingContainer()
{
LogoFacade = new ExposedFacade();
}
/// <summary> /// <summary>
/// Assign the logo that should track the Facade's position, as well as how it should transform to its initial position. /// Assign the logo that should track the facade's position, as well as how it should transform to its initial position.
/// </summary> /// </summary>
/// <param name="logo">The instance of the logo to be used for tracking.</param> /// <param name="logo">The instance of the logo to be used for tracking.</param>
/// <param name="facadeScale">The scale of the facade. Does not actually affect the logo itself.</param> /// <param name="facadeScale">The scale of the facade. Does not actually affect the logo itself.</param>
@ -96,7 +93,7 @@ namespace osu.Game.Graphics.Containers
throw new InvalidOperationException($"Tracking logo must have {nameof(RelativePositionAxes)} = Axes.Both"); throw new InvalidOperationException($"Tracking logo must have {nameof(RelativePositionAxes)} = Axes.Both");
// Account for the scale of the actual OsuLogo, as SizeForFlow only accounts for the sprite scale. // Account for the scale of the actual OsuLogo, as SizeForFlow only accounts for the sprite scale.
((ExposedFacade)LogoFacade).SetSize(new Vector2(Logo.SizeForFlow * Logo.Scale.X)); facade.SetSize(new Vector2(Logo.SizeForFlow * Logo.Scale.X));
var localPos = ComputeLogoTrackingPosition(); var localPos = ComputeLogoTrackingPosition();
@ -133,7 +130,7 @@ namespace osu.Game.Graphics.Containers
base.Dispose(isDisposing); base.Dispose(isDisposing);
} }
private class ExposedFacade : Facade private class InternalFacade : Facade
{ {
public void SetSize(Vector2 size) public void SetSize(Vector2 size)
{ {