1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-25 11:10:07 +08:00

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
Unverified
+3 -4
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 @@ namespace osu.Game.Rulesets.Objects
/// </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 @@ namespace osu.Game.Rulesets.Objects
CreateNestedHitObjects();
nestedHitObjects.Sort((h1, h2) => h1.StartTime.CompareTo(h2.StartTime));
foreach (var h in nestedHitObjects)
{
h.HitWindows = HitWindows;
@@ -114,7 +115,5 @@ namespace osu.Game.Rulesets.Objects
/// </para>
/// </summary>
protected virtual HitWindows CreateHitWindows() => new HitWindows();
private static int compareObjects(HitObject first, HitObject second) => first.StartTime.CompareTo(second.StartTime);
}
}