Flip direction to avoid breaking other usages

This commit is contained in:
Dean Herbert 2020-05-29 16:11:26 +09:00
parent 7f8f41715d
commit 3b6619a360
2 changed files with 28 additions and 4 deletions

View File

@ -8,17 +8,27 @@ namespace osu.Game.Rulesets.Objects.Types
/// <summary>
/// A HitObject that ends at a different time than its start time.
/// </summary>
public interface IHasDuration
#pragma warning disable 618
public interface IHasDuration : IHasEndTime
#pragma warning restore 618
{
double IHasEndTime.EndTime
{
get => EndTime;
set => Duration = (Duration - EndTime) + value;
}
double IHasEndTime.Duration => Duration;
/// <summary>
/// The time at which the HitObject ends.
/// </summary>
double EndTime { get; }
new double EndTime { get; }
/// <summary>
/// The duration of the HitObject.
/// </summary>
[JsonIgnore]
double Duration { get; set; }
new double Duration { get; set; }
}
}

View File

@ -2,11 +2,25 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using Newtonsoft.Json;
namespace osu.Game.Rulesets.Objects.Types
{
/// <summary>
/// A HitObject that ends at a different time than its start time.
/// </summary>
[Obsolete("Use IHasDuration instead.")] // can be removed 20201126
public interface IHasEndTime : IHasDuration
public interface IHasEndTime
{
/// <summary>
/// The time at which the HitObject ends.
/// </summary>
[JsonIgnore]
double EndTime { get; set; }
/// <summary>
/// The duration of the HitObject.
/// </summary>
double Duration { get; }
}
}