diff --git a/osu.Game/Beatmaps/Objects/Catch/Drawable/DrawableFruit.cs b/osu.Game/Beatmaps/Objects/Catch/Drawable/DrawableFruit.cs index 028afff5cc..3a3883ab3b 100644 --- a/osu.Game/Beatmaps/Objects/Catch/Drawable/DrawableFruit.cs +++ b/osu.Game/Beatmaps/Objects/Catch/Drawable/DrawableFruit.cs @@ -34,8 +34,8 @@ namespace osu.Game.Beatmaps.Objects.Catch.Drawable Texture = game.Textures.Get(@"Menu/logo"); - Transforms.Add(new TransformPosition(Clock) { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = new Vector2(h.Position, -0.1f), EndValue = new Vector2(h.Position, 0.9f) }); - Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 }); + Transforms.Add(new TransformPosition { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = new Vector2(h.Position, -0.1f), EndValue = new Vector2(h.Position, 0.9f) }); + Transforms.Add(new TransformAlpha { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 }); Expire(true); } } diff --git a/osu.Game/Beatmaps/Objects/Mania/Drawable/DrawableNote.cs b/osu.Game/Beatmaps/Objects/Mania/Drawable/DrawableNote.cs index 132fb6ce36..939dc645cd 100644 --- a/osu.Game/Beatmaps/Objects/Mania/Drawable/DrawableNote.cs +++ b/osu.Game/Beatmaps/Objects/Mania/Drawable/DrawableNote.cs @@ -25,8 +25,8 @@ namespace osu.Game.Beatmaps.Objects.Mania.Drawable base.Load(game); Texture = game.Textures.Get(@"Menu/logo"); - Transforms.Add(new TransformPositionY(Clock) { StartTime = note.StartTime - 200, EndTime = note.StartTime, StartValue = -0.1f, EndValue = 0.9f }); - Transforms.Add(new TransformAlpha(Clock) { StartTime = note.StartTime + note.Duration + 200, EndTime = note.StartTime + note.Duration + 400, StartValue = 1, EndValue = 0 }); + Transforms.Add(new TransformPositionY() { StartTime = note.StartTime - 200, EndTime = note.StartTime, StartValue = -0.1f, EndValue = 0.9f }); + Transforms.Add(new TransformAlpha() { StartTime = note.StartTime + note.Duration + 200, EndTime = note.StartTime + note.Duration + 400, StartValue = 1, EndValue = 0 }); Expire(true); } } diff --git a/osu.Game/Beatmaps/Objects/Osu/Drawable/DrawableCircle.cs b/osu.Game/Beatmaps/Objects/Osu/Drawable/DrawableCircle.cs index bbfcac9d39..be2b7495f6 100644 --- a/osu.Game/Beatmaps/Objects/Osu/Drawable/DrawableCircle.cs +++ b/osu.Game/Beatmaps/Objects/Osu/Drawable/DrawableCircle.cs @@ -77,36 +77,36 @@ namespace osu.Game.Beatmaps.Objects.Osu.Drawable Flush(); //move to DrawableHitObject - Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime - 1000, EndTime = h.StartTime - 800, StartValue = 0, EndValue = 1 }); + Transforms.Add(new TransformAlpha { StartTime = h.StartTime - 1000, EndTime = h.StartTime - 800, StartValue = 0, EndValue = 1 }); - approachCircle.Transforms.Add(new TransformScale(Clock) { StartTime = h.StartTime - 1000, EndTime = h.StartTime, StartValue = new Vector2(2f), EndValue = new Vector2(0.6f) }); - approachCircle.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime, EndTime = h.StartTime, StartValue = 1, EndValue = 0 }); + approachCircle.Transforms.Add(new TransformScale { StartTime = h.StartTime - 1000, EndTime = h.StartTime, StartValue = new Vector2(2f), EndValue = new Vector2(0.6f) }); + approachCircle.Transforms.Add(new TransformAlpha { StartTime = h.StartTime, EndTime = h.StartTime, StartValue = 1, EndValue = 0 }); - glow.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime, EndTime = h.StartTime + 400, StartValue = glow.Alpha, EndValue = 0 }); + glow.Transforms.Add(new TransformAlpha { StartTime = h.StartTime, EndTime = h.StartTime + 400, StartValue = glow.Alpha, EndValue = 0 }); switch (state) { case ArmedState.Disarmed: - Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 }); + Transforms.Add(new TransformAlpha { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 }); break; case ArmedState.Armed: const float flashIn = 30; const float fadeOut = 800; - //Transforms.Add(new TransformScale(Clock) { StartTime = h.StartTime, EndTime = h.StartTime + 400, StartValue = Scale, EndValue = Scale * 1.1f }); + //Transforms.Add(new TransformScale() { StartTime = h.StartTime, EndTime = h.StartTime + 400, StartValue = Scale, EndValue = Scale * 1.1f }); - ring.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + flashIn, EndTime = h.StartTime + flashIn, StartValue = 0, EndValue = 0 }); - circle.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + flashIn, EndTime = h.StartTime + flashIn, StartValue = 0, EndValue = 0 }); - number.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + flashIn, EndTime = h.StartTime + flashIn, StartValue = 0, EndValue = 0 }); + ring.Transforms.Add(new TransformAlpha { StartTime = h.StartTime + flashIn, EndTime = h.StartTime + flashIn, StartValue = 0, EndValue = 0 }); + circle.Transforms.Add(new TransformAlpha { StartTime = h.StartTime + flashIn, EndTime = h.StartTime + flashIn, StartValue = 0, EndValue = 0 }); + number.Transforms.Add(new TransformAlpha { StartTime = h.StartTime + flashIn, EndTime = h.StartTime + flashIn, StartValue = 0, EndValue = 0 }); - flash.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime, EndTime = h.StartTime + flashIn, StartValue = 0, EndValue = 0.8f }); - flash.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + flashIn, EndTime = h.StartTime + flashIn + 100, StartValue = 0.8f, EndValue = 0 }); + flash.Transforms.Add(new TransformAlpha { StartTime = h.StartTime, EndTime = h.StartTime + flashIn, StartValue = 0, EndValue = 0.8f }); + flash.Transforms.Add(new TransformAlpha { StartTime = h.StartTime + flashIn, EndTime = h.StartTime + flashIn + 100, StartValue = 0.8f, EndValue = 0 }); - explode.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime, EndTime = h.StartTime + flashIn, StartValue = 0, EndValue = 1 }); + explode.Transforms.Add(new TransformAlpha { StartTime = h.StartTime, EndTime = h.StartTime + flashIn, StartValue = 0, EndValue = 1 }); - Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + flashIn, EndTime = h.StartTime + flashIn + fadeOut, StartValue = 1, EndValue = 0 }); + Transforms.Add(new TransformAlpha { StartTime = h.StartTime + flashIn, EndTime = h.StartTime + flashIn + fadeOut, StartValue = 1, EndValue = 0 }); - Transforms.Add(new TransformScale(Clock) { StartTime = h.StartTime + h.Duration, EndTime = h.StartTime + h.Duration + 400, StartValue = Scale, EndValue = Scale * 1.5f, Easing = EasingTypes.OutQuad }); + Transforms.Add(new TransformScale { StartTime = h.StartTime + h.Duration, EndTime = h.StartTime + h.Duration + 400, StartValue = Scale, EndValue = Scale * 1.5f, Easing = EasingTypes.OutQuad }); break; } } diff --git a/osu.Game/Beatmaps/Objects/Taiko/Drawable/DrawableTaikoHit.cs b/osu.Game/Beatmaps/Objects/Taiko/Drawable/DrawableTaikoHit.cs index dafbe33415..c0354124c7 100644 --- a/osu.Game/Beatmaps/Objects/Taiko/Drawable/DrawableTaikoHit.cs +++ b/osu.Game/Beatmaps/Objects/Taiko/Drawable/DrawableTaikoHit.cs @@ -29,8 +29,8 @@ namespace osu.Game.Beatmaps.Objects.Taiko.Drawable Texture = game.Textures.Get(@"Menu/logo"); - Transforms.Add(new TransformPositionX(Clock) { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = 1.1f, EndValue = 0.1f }); - Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 }); + Transforms.Add(new TransformPositionX { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = 1.1f, EndValue = 0.1f }); + Transforms.Add(new TransformAlpha { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 }); Expire(true); } } diff --git a/osu.Game/GameModes/Menu/Button.cs b/osu.Game/GameModes/Menu/Button.cs index b278cefbd9..e8fb4d848c 100644 --- a/osu.Game/GameModes/Menu/Button.cs +++ b/osu.Game/GameModes/Menu/Button.cs @@ -117,7 +117,7 @@ namespace osu.Game.GameModes.Menu icon.RotateTo(10, offset, EasingTypes.InOutSine); icon.ScaleTo(new Vector2(1, 0.9f), offset, EasingTypes.Out); - icon.Transforms.Add(new TransformRotation(Clock) + icon.Transforms.Add(new TransformRotation { StartValue = -10, EndValue = 10, @@ -128,7 +128,7 @@ namespace osu.Game.GameModes.Menu LoopDelay = duration * 2 }); - icon.Transforms.Add(new TransformPosition(Clock) + icon.Transforms.Add(new TransformPosition() { StartValue = Vector2.Zero, EndValue = new Vector2(0, -10), @@ -139,7 +139,7 @@ namespace osu.Game.GameModes.Menu LoopDelay = duration }); - icon.Transforms.Add(new TransformScale(Clock) + icon.Transforms.Add(new TransformScale() { StartValue = new Vector2(1, 0.9f), EndValue = Vector2.One, @@ -150,7 +150,7 @@ namespace osu.Game.GameModes.Menu LoopDelay = duration }); - icon.Transforms.Add(new TransformPosition(Clock) + icon.Transforms.Add(new TransformPosition() { StartValue = new Vector2(0, -10), EndValue = Vector2.Zero, @@ -161,7 +161,7 @@ namespace osu.Game.GameModes.Menu LoopDelay = duration }); - icon.Transforms.Add(new TransformScale(Clock) + icon.Transforms.Add(new TransformScale() { StartValue = Vector2.One, EndValue = new Vector2(1, 0.9f), @@ -172,7 +172,7 @@ namespace osu.Game.GameModes.Menu LoopDelay = duration }); - icon.Transforms.Add(new TransformRotation(Clock) + icon.Transforms.Add(new TransformRotation { StartValue = 10, EndValue = -10, diff --git a/osu.Game/GameModes/Play/ComboCounter.cs b/osu.Game/GameModes/Play/ComboCounter.cs index c40d7a4964..ebc89c102e 100644 --- a/osu.Game/GameModes/Play/ComboCounter.cs +++ b/osu.Game/GameModes/Play/ComboCounter.cs @@ -174,7 +174,7 @@ namespace osu.Game.GameModes.Play protected virtual void OnCountRolling(ulong currentValue, ulong newValue) { - transformRoll(new TransformComboRoll(Clock), currentValue, newValue); + transformRoll(new TransformComboRoll(), currentValue, newValue); } protected virtual void OnCountIncrement(ulong currentValue, ulong newValue) { @@ -248,11 +248,11 @@ namespace osu.Game.GameModes.Play protected class TransformComboRoll : Transform { - public override ulong CurrentValue + protected override ulong CurrentValue { get { - double time = Time; + double time = CurrentTime ?? 0; if (time < StartTime) return StartValue; if (time >= EndTime) return EndValue; @@ -265,11 +265,6 @@ namespace osu.Game.GameModes.Play base.Apply(d); (d as ComboCounter).DisplayedCount = CurrentValue; } - - public TransformComboRoll(IClock clock) - : base(clock) - { - } } } } diff --git a/osu.Game/GameModes/Play/ComboResultCounter.cs b/osu.Game/GameModes/Play/ComboResultCounter.cs index a07e35b263..fd96906d18 100644 --- a/osu.Game/GameModes/Play/ComboResultCounter.cs +++ b/osu.Game/GameModes/Play/ComboResultCounter.cs @@ -41,11 +41,11 @@ namespace osu.Game.GameModes.Play protected class TransformComboResult : Transform { - public override ulong CurrentValue + protected override ulong CurrentValue { get { - double time = Time; + double time = CurrentTime ?? 0; if (time < StartTime) return StartValue; if (time >= EndTime) return EndValue; @@ -58,11 +58,6 @@ namespace osu.Game.GameModes.Play base.Apply(d); (d as ComboResultCounter).DisplayedCount = CurrentValue; } - - public TransformComboResult(IClock clock) - : base(clock) - { - } } } } diff --git a/osu.Game/Graphics/UserInterface/PercentageCounter.cs b/osu.Game/Graphics/UserInterface/PercentageCounter.cs index b12126deb6..b045089dcd 100644 --- a/osu.Game/Graphics/UserInterface/PercentageCounter.cs +++ b/osu.Game/Graphics/UserInterface/PercentageCounter.cs @@ -57,11 +57,6 @@ namespace osu.Game.Graphics.UserInterface base.Apply(d); (d as PercentageCounter).DisplayedCount = CurrentValue; } - - public TransformAccuracy(IClock clock) - : base(clock) - { - } } } } diff --git a/osu.Game/Graphics/UserInterface/RollingCounter.cs b/osu.Game/Graphics/UserInterface/RollingCounter.cs index 69e7b6e495..33a1677bd9 100644 --- a/osu.Game/Graphics/UserInterface/RollingCounter.cs +++ b/osu.Game/Graphics/UserInterface/RollingCounter.cs @@ -194,14 +194,12 @@ namespace osu.Game.Graphics.UserInterface /// protected virtual void TransformCount(T currentValue, T newValue) { - object[] parameters = { Clock }; - Debug.Assert( TransformType.IsSubclassOf(typeof(Transform)) || TransformType == typeof(Transform), @"transformType should be a subclass of Transform." ); - TransformCount((Transform)Activator.CreateInstance(TransformType, parameters), currentValue, newValue); + TransformCount((Transform)Activator.CreateInstance(TransformType), currentValue, newValue); } /// diff --git a/osu.Game/Graphics/UserInterface/ScoreCounter.cs b/osu.Game/Graphics/UserInterface/ScoreCounter.cs index eb857a3207..48f4da1fcf 100644 --- a/osu.Game/Graphics/UserInterface/ScoreCounter.cs +++ b/osu.Game/Graphics/UserInterface/ScoreCounter.cs @@ -56,11 +56,11 @@ namespace osu.Game.Graphics.UserInterface protected class TransformScore : Transform { - public override ulong CurrentValue + protected override ulong CurrentValue { get { - double time = Time; + double time = CurrentTime ?? 0; if (time < StartTime) return StartValue; if (time >= EndTime) return EndValue; @@ -73,11 +73,6 @@ namespace osu.Game.Graphics.UserInterface base.Apply(d); (d as ScoreCounter).DisplayedCount = CurrentValue; } - - public TransformScore(IClock clock) - : base(clock) - { - } } } }