1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 17:27:24 +08:00

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> /// <summary>
/// A HitObject that ends at a different time than its start time. /// A HitObject that ends at a different time than its start time.
/// </summary> /// </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> /// <summary>
/// The time at which the HitObject ends. /// The time at which the HitObject ends.
/// </summary> /// </summary>
double EndTime { get; } new double EndTime { get; }
/// <summary> /// <summary>
/// The duration of the HitObject. /// The duration of the HitObject.
/// </summary> /// </summary>
[JsonIgnore] [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. // See the LICENCE file in the repository root for full licence text.
using System; using System;
using Newtonsoft.Json;
namespace osu.Game.Rulesets.Objects.Types 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 [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; }
} }
} }