Revert EditorBeatmap.Remove API

This commit is contained in:
Dean Herbert
2020-09-14 17:55:41 +09:00
parent 70bc0b2bd0
commit daf54c7eb9

View File

@ -146,19 +146,17 @@ namespace osu.Game.Screens.Edit
/// <summary> /// <summary>
/// Removes a <see cref="HitObject"/> from this <see cref="EditorBeatmap"/>. /// Removes a <see cref="HitObject"/> from this <see cref="EditorBeatmap"/>.
/// </summary> /// </summary>
/// <param name="hitObjects">All <see cref="HitObject"/> to remove.</param> /// <param name="hitObject">The <see cref="HitObject"/> to remove.</param>
/// <returns>True if the <see cref="HitObject"/> has been removed, false otherwise.</returns> /// <returns>True if the <see cref="HitObject"/> has been removed, false otherwise.</returns>
public void Remove(params HitObject[] hitObjects) public bool Remove(HitObject hitObject)
{ {
foreach (var h in hitObjects) int index = FindIndex(hitObject);
{
int index = FindIndex(h);
if (index == -1) if (index == -1)
continue; return false;
RemoveAt(index); RemoveAt(index);
} return true;
} }
/// <summary> /// <summary>
@ -195,9 +193,7 @@ namespace osu.Game.Screens.Edit
/// </summary> /// </summary>
public void Clear() public void Clear()
{ {
var removable = HitObjects.ToList(); foreach (var h in HitObjects.ToArray())
foreach (var h in removable)
Remove(h); Remove(h);
} }