mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 11:42:56 +08:00
Rename to StartTimeChanged and add xmldocs
This commit is contained in:
parent
f2719afd0e
commit
3fb0b0b668
@ -58,7 +58,7 @@ namespace osu.Game.Tests.Beatmaps
|
||||
var editorBeatmap = new EditorBeatmap<OsuHitObject>(new OsuBeatmap { HitObjects = { hitCircle } });
|
||||
|
||||
HitObject changedObject = null;
|
||||
editorBeatmap.HitObjectChanged += h => changedObject = h;
|
||||
editorBeatmap.StartTimeChanged += h => changedObject = h;
|
||||
|
||||
hitCircle.StartTime = 1000;
|
||||
Assert.That(changedObject, Is.EqualTo(hitCircle));
|
||||
@ -74,7 +74,7 @@ namespace osu.Game.Tests.Beatmaps
|
||||
var editorBeatmap = new EditorBeatmap<OsuHitObject>(new OsuBeatmap());
|
||||
|
||||
HitObject changedObject = null;
|
||||
editorBeatmap.HitObjectChanged += h => changedObject = h;
|
||||
editorBeatmap.StartTimeChanged += h => changedObject = h;
|
||||
|
||||
var hitCircle = new HitCircle();
|
||||
|
||||
@ -95,7 +95,7 @@ namespace osu.Game.Tests.Beatmaps
|
||||
var editorBeatmap = new EditorBeatmap<OsuHitObject>(new OsuBeatmap { HitObjects = { hitCircle } });
|
||||
|
||||
HitObject changedObject = null;
|
||||
editorBeatmap.HitObjectChanged += h => changedObject = h;
|
||||
editorBeatmap.StartTimeChanged += h => changedObject = h;
|
||||
|
||||
editorBeatmap.Remove(hitCircle);
|
||||
Assert.That(changedObject, Is.Null);
|
||||
|
@ -14,9 +14,20 @@ namespace osu.Game.Screens.Edit
|
||||
public class EditorBeatmap<T> : IEditorBeatmap<T>
|
||||
where T : HitObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Invoked when a <see cref="HitObject"/> is added to this <see cref="EditorBeatmap{T}"/>.
|
||||
/// </summary>
|
||||
public event Action<HitObject> HitObjectAdded;
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when a <see cref="HitObject"/> is removed from this <see cref="EditorBeatmap{T}"/>.
|
||||
/// </summary>
|
||||
public event Action<HitObject> HitObjectRemoved;
|
||||
public event Action<HitObject> HitObjectChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when the start time of a <see cref="HitObject"/> in this <see cref="EditorBeatmap{T}"/> was changed.
|
||||
/// </summary>
|
||||
public event Action<HitObject> StartTimeChanged;
|
||||
|
||||
private readonly Dictionary<T, Bindable<double>> startTimeBindables = new Dictionary<T, Bindable<double>>();
|
||||
private readonly Beatmap<T> beatmap;
|
||||
@ -93,7 +104,7 @@ namespace osu.Game.Screens.Edit
|
||||
var insertionIndex = beatmap.HitObjects.FindLastIndex(h => h.StartTime <= hitObject.StartTime);
|
||||
beatmap.HitObjects.Insert(insertionIndex + 1, hitObject);
|
||||
|
||||
HitObjectChanged?.Invoke(hitObject);
|
||||
StartTimeChanged?.Invoke(hitObject);
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user