mirror of
https://github.com/ppy/osu.git
synced 2025-02-28 06:52:55 +08:00
Add clear method to EditorBeatmap
This commit is contained in:
parent
c9ca996d08
commit
dcfef6b443
@ -4,6 +4,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
@ -201,6 +202,25 @@ namespace osu.Game.Screens.Edit
|
|||||||
updateHitObject(null, true);
|
updateHitObject(null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clears all <see cref="HitObjects"/> from this <see cref="EditorBeatmap"/>.
|
||||||
|
/// </summary>
|
||||||
|
public void Clear()
|
||||||
|
{
|
||||||
|
var removed = HitObjects.ToList();
|
||||||
|
|
||||||
|
mutableHitObjects.Clear();
|
||||||
|
|
||||||
|
foreach (var b in startTimeBindables)
|
||||||
|
b.Value.UnbindAll();
|
||||||
|
startTimeBindables.Clear();
|
||||||
|
|
||||||
|
foreach (var h in removed)
|
||||||
|
HitObjectRemoved?.Invoke(h);
|
||||||
|
|
||||||
|
updateHitObject(null, true);
|
||||||
|
}
|
||||||
|
|
||||||
private void trackStartTime(HitObject hitObject)
|
private void trackStartTime(HitObject hitObject)
|
||||||
{
|
{
|
||||||
startTimeBindables[hitObject] = hitObject.StartTimeBindable.GetBoundCopy();
|
startTimeBindables[hitObject] = hitObject.StartTimeBindable.GetBoundCopy();
|
||||||
|
Loading…
Reference in New Issue
Block a user