Merge pull request #3678 from smoogipoo/force-sort-objects

Sort nested hitobjects post-creation
This commit is contained in:
Dean Herbert 2018-11-05 16:31:39 +09:00 committed by GitHub
commit 09b2710fbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -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);
}
}