mirror of https://github.com/ppy/osu
Fix comparison interface not implemented on storyboard command classes
This commit is contained in:
parent
3755dd059a
commit
2ca36254f4
|
@ -1,12 +1,13 @@
|
||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Transforms;
|
using osu.Framework.Graphics.Transforms;
|
||||||
|
|
||||||
namespace osu.Game.Storyboards.Commands
|
namespace osu.Game.Storyboards.Commands
|
||||||
{
|
{
|
||||||
public abstract class StoryboardCommand<T> : IStoryboardCommand
|
public abstract class StoryboardCommand<T> : IStoryboardCommand, IComparable<StoryboardCommand<T>>
|
||||||
{
|
{
|
||||||
public double StartTime { get; }
|
public double StartTime { get; }
|
||||||
public double EndTime { get; }
|
public double EndTime { get; }
|
||||||
|
@ -41,10 +42,14 @@ protected StoryboardCommand(double startTime, double endTime, T startValue, T en
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract TransformSequence<Drawable> ApplyTransform(Drawable d);
|
public abstract TransformSequence<Drawable> ApplyTransform(Drawable d);
|
||||||
|
|
||||||
public int CompareTo(IStoryboardCommand other)
|
public int CompareTo(StoryboardCommand<T>? other)
|
||||||
{
|
{
|
||||||
|
if (other == null)
|
||||||
|
return 1;
|
||||||
|
|
||||||
int result = StartTime.CompareTo(other.StartTime);
|
int result = StartTime.CompareTo(other.StartTime);
|
||||||
if (result != 0) return result;
|
if (result != 0)
|
||||||
|
return result;
|
||||||
|
|
||||||
return EndTime.CompareTo(other.EndTime);
|
return EndTime.CompareTo(other.EndTime);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue