Centralise End/StartTime retrieval to extension method

This commit is contained in:
Dean Herbert
2019-11-25 19:01:24 +09:00
parent 5e8f3eb28f
commit 709ec1404f
19 changed files with 47 additions and 42 deletions

View File

@ -12,7 +12,6 @@ using System.Linq;
using osu.Framework.Bindables;
using osu.Framework.Timing;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.UI;
namespace osu.Game.Screens.Play
@ -34,7 +33,8 @@ namespace osu.Game.Screens.Play
public override bool HandleNonPositionalInput => AllowSeeking;
public override bool HandlePositionalInput => AllowSeeking;
private double lastHitTime => ((objects.Last() as IHasEndTime)?.EndTime ?? objects.Last().StartTime) + 1;
//TODO: this isn't always correct (consider mania where a non-last object may last for longer than the last in the list).
private double lastHitTime => objects.Last().GetEndTime() + 1;
private double firstHitTime => objects.First().StartTime;