mirror of
https://github.com/ppy/osu.git
synced 2025-02-26 06:42:54 +08:00
Flip direction to avoid breaking other usages
This commit is contained in:
parent
7f8f41715d
commit
3b6619a360
@ -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; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user