diff --git a/osu.Game/Rulesets/Objects/Types/IHasDuration.cs b/osu.Game/Rulesets/Objects/Types/IHasDuration.cs
index 2433f9597e..185fd5977b 100644
--- a/osu.Game/Rulesets/Objects/Types/IHasDuration.cs
+++ b/osu.Game/Rulesets/Objects/Types/IHasDuration.cs
@@ -8,17 +8,27 @@ namespace osu.Game.Rulesets.Objects.Types
///
/// A HitObject that ends at a different time than its start time.
///
- 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;
+
///
/// The time at which the HitObject ends.
///
- double EndTime { get; }
+ new double EndTime { get; }
///
/// The duration of the HitObject.
///
[JsonIgnore]
- double Duration { get; set; }
+ new double Duration { get; set; }
}
}
diff --git a/osu.Game/Rulesets/Objects/Types/IHasEndTime.cs b/osu.Game/Rulesets/Objects/Types/IHasEndTime.cs
index 7395223c7e..c3769c5909 100644
--- a/osu.Game/Rulesets/Objects/Types/IHasEndTime.cs
+++ b/osu.Game/Rulesets/Objects/Types/IHasEndTime.cs
@@ -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
{
+ ///
+ /// A HitObject that ends at a different time than its start time.
+ ///
[Obsolete("Use IHasDuration instead.")] // can be removed 20201126
- public interface IHasEndTime : IHasDuration
+ public interface IHasEndTime
{
+ ///
+ /// The time at which the HitObject ends.
+ ///
+ [JsonIgnore]
+ double EndTime { get; set; }
+
+ ///
+ /// The duration of the HitObject.
+ ///
+ double Duration { get; }
}
}