mirror of https://github.com/ppy/osu
Merge pull request #3678 from smoogipoo/force-sort-objects
Sort nested hitobjects post-creation
This commit is contained in:
commit
09b2710fbf
|
@ -3,7 +3,6 @@
|
|||
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using osu.Framework.Lists;
|
||||
using osu.Game.Audio;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.ControlPoints;
|
||||
|
@ -56,7 +55,7 @@ public List<SampleInfo> Samples
|
|||
/// </summary>
|
||||
public HitWindows HitWindows { get; set; }
|
||||
|
||||
private readonly SortedList<HitObject> nestedHitObjects = new SortedList<HitObject>(compareObjects);
|
||||
private readonly List<HitObject> nestedHitObjects = new List<HitObject>();
|
||||
|
||||
[JsonIgnore]
|
||||
public IReadOnlyList<HitObject> NestedHitObjects => nestedHitObjects;
|
||||
|
@ -74,6 +73,8 @@ public void ApplyDefaults(ControlPointInfo controlPointInfo, BeatmapDifficulty d
|
|||
|
||||
CreateNestedHitObjects();
|
||||
|
||||
nestedHitObjects.Sort((h1, h2) => h1.StartTime.CompareTo(h2.StartTime));
|
||||
|
||||
foreach (var h in nestedHitObjects)
|
||||
{
|
||||
h.HitWindows = HitWindows;
|
||||
|
@ -114,7 +115,5 @@ protected virtual void CreateNestedHitObjects()
|
|||
/// </para>
|
||||
/// </summary>
|
||||
protected virtual HitWindows CreateHitWindows() => new HitWindows();
|
||||
|
||||
private static int compareObjects(HitObject first, HitObject second) => first.StartTime.CompareTo(second.StartTime);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue