mirror of
https://github.com/ppy/osu.git
synced 2024-12-05 09:42:54 +08:00
fix typo
This commit is contained in:
parent
0ac520dec8
commit
cb5be12f47
@ -5,7 +5,7 @@ using osu.Game.Rulesets.Objects;
|
||||
|
||||
namespace osu.Game.Screens.Edit.Changes
|
||||
{
|
||||
public class AddHitObjectChange : IRevertableChange
|
||||
public class AddHitObjectChange : IRevertibleChange
|
||||
{
|
||||
public EditorBeatmap Beatmap;
|
||||
|
||||
|
@ -6,7 +6,7 @@ namespace osu.Game.Screens.Edit.Changes
|
||||
/// <summary>
|
||||
/// Represents a change which can be undone.
|
||||
/// </summary>
|
||||
public interface IRevertableChange
|
||||
public interface IRevertibleChange
|
||||
{
|
||||
/// <summary>
|
||||
/// Applies this change to the current state.
|
||||
@ -18,4 +18,15 @@ namespace osu.Game.Screens.Edit.Changes
|
||||
/// </summary>
|
||||
void Revert();
|
||||
}
|
||||
|
||||
public static class IRevertibleChangeExtension
|
||||
{
|
||||
public static void Submit(this IRevertibleChange change, NewBeatmapEditorChangeHandler? changeHandler, bool commitImmediately = false)
|
||||
{
|
||||
if (changeHandler != null)
|
||||
changeHandler.Submit(change, commitImmediately);
|
||||
else
|
||||
change.Apply();
|
||||
}
|
||||
}
|
||||
}
|
@ -6,7 +6,7 @@ using osu.Game.Rulesets.Objects;
|
||||
|
||||
namespace osu.Game.Screens.Edit.Changes
|
||||
{
|
||||
public class InsertPathControlPointChange : IRevertableChange
|
||||
public class InsertPathControlPointChange : IRevertibleChange
|
||||
{
|
||||
public readonly IList<PathControlPoint> Target;
|
||||
|
||||
|
@ -8,7 +8,7 @@ namespace osu.Game.Screens.Edit.Changes
|
||||
/// </summary>
|
||||
/// <typeparam name="TTarget">Type of the object owning the property</typeparam>
|
||||
/// <typeparam name="TValue">Type of the property to update</typeparam>
|
||||
public abstract class PropertyChange<TTarget, TValue> : IRevertableChange where TTarget : class
|
||||
public abstract class PropertyChange<TTarget, TValue> : IRevertibleChange where TTarget : class
|
||||
{
|
||||
/// <summary>
|
||||
/// Reads the current value of the property from the target.
|
||||
|
@ -9,7 +9,7 @@ namespace osu.Game.Screens.Edit.Changes
|
||||
/// Queues the update of a <see cref="HitObject"/> in an <see cref="EditorBeatmap"/> for undo/redo.
|
||||
/// The order of the updates in the transaction does not matter, because the updates are aggregated and applied on the next frame.
|
||||
/// </summary>
|
||||
public class QueueUpdateHitObject : IRevertableChange
|
||||
public class QueueUpdateHitObject : IRevertibleChange
|
||||
{
|
||||
public EditorBeatmap? Beatmap;
|
||||
|
||||
|
@ -5,7 +5,7 @@ using osu.Game.Rulesets.Objects;
|
||||
|
||||
namespace osu.Game.Screens.Edit.Changes
|
||||
{
|
||||
public class RemoveHitObjectChange : IRevertableChange
|
||||
public class RemoveHitObjectChange : IRevertibleChange
|
||||
{
|
||||
public EditorBeatmap Beatmap;
|
||||
|
||||
|
@ -6,7 +6,7 @@ using osu.Game.Rulesets.Objects;
|
||||
|
||||
namespace osu.Game.Screens.Edit.Changes
|
||||
{
|
||||
public class RemovePathControlPointChange : IRevertableChange
|
||||
public class RemovePathControlPointChange : IRevertibleChange
|
||||
{
|
||||
public readonly IList<PathControlPoint> Target;
|
||||
|
||||
|
@ -42,7 +42,7 @@ namespace osu.Game.Screens.Edit
|
||||
/// </summary>
|
||||
/// <param name="change">Change to be applied.</param>
|
||||
/// <param name="commitImmediately">Whether to commit the current transaction and push it onto the undo stack immediately.</param>
|
||||
public void Submit(IRevertableChange change, bool commitImmediately = false)
|
||||
public void Submit(IRevertibleChange change, bool commitImmediately = false)
|
||||
{
|
||||
change.Apply();
|
||||
record(change);
|
||||
@ -56,7 +56,7 @@ namespace osu.Game.Screens.Edit
|
||||
/// </summary>
|
||||
/// <param name="changes">Changes to be applied.</param>
|
||||
/// <param name="commitImmediately">Whether to commit the current transaction and push it onto the undo stack immediately.</param>
|
||||
public void Submit(IEnumerable<IRevertableChange> changes, bool commitImmediately = false)
|
||||
public void Submit(IEnumerable<IRevertibleChange> changes, bool commitImmediately = false)
|
||||
{
|
||||
foreach (var change in changes)
|
||||
Submit(change);
|
||||
@ -156,7 +156,7 @@ namespace osu.Game.Screens.Edit
|
||||
CanRedo.Value = redoStack.Count > 0;
|
||||
}
|
||||
|
||||
private void record(IRevertableChange change)
|
||||
private void record(IRevertibleChange change)
|
||||
{
|
||||
currentTransaction.Add(change);
|
||||
}
|
||||
@ -165,18 +165,18 @@ namespace osu.Game.Screens.Edit
|
||||
{
|
||||
public Transaction()
|
||||
{
|
||||
undoChanges = new List<IRevertableChange>();
|
||||
undoChanges = new List<IRevertibleChange>();
|
||||
}
|
||||
|
||||
private readonly List<IRevertableChange> undoChanges;
|
||||
private readonly List<IRevertibleChange> undoChanges;
|
||||
|
||||
/// <summary>
|
||||
/// The changes to undo the given transaction.
|
||||
/// Stored in reverse order of original changes to match execution order when undoing.
|
||||
/// </summary>
|
||||
public IReadOnlyList<IRevertableChange> UndoChanges => undoChanges;
|
||||
public IReadOnlyList<IRevertibleChange> UndoChanges => undoChanges;
|
||||
|
||||
public void Add(IRevertableChange change)
|
||||
public void Add(IRevertibleChange change)
|
||||
{
|
||||
undoChanges.Add(change);
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ namespace osu.Game.Screens.Edit
|
||||
{
|
||||
public static class NewBeatmapEditorChangeHandlerExtension
|
||||
{
|
||||
public static void SafeSubmit(this NewBeatmapEditorChangeHandler? manager, IRevertableChange command, bool commitImmediately = false)
|
||||
public static void SafeSubmit(this NewBeatmapEditorChangeHandler? manager, IRevertibleChange command, bool commitImmediately = false)
|
||||
{
|
||||
if (manager != null)
|
||||
manager.Submit(command, commitImmediately);
|
||||
|
Loading…
Reference in New Issue
Block a user