// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using osu.Framework.Allocation; using osu.Game.Rulesets.Objects; namespace osu.Game.Screens.Edit { /// /// Interface for a component that manages changes in the . /// [Cached] public interface IEditorChangeHandler { /// /// Fired whenever a state change occurs. /// event Action? OnStateChange; /// /// Begins a bulk state change event. should be invoked soon after. /// /// /// This should be invoked when multiple changes to the should be bundled together into one state change event. /// When nested invocations are involved, a state change will not occur until an equal number of invocations of are received. /// /// /// When a group of s are deleted, a single undo and redo state change should update the state of all . /// void BeginChange(); /// /// Ends a bulk state change event. /// /// /// This should be invoked as soon as possible after to cause a state change. /// void EndChange(); /// /// Immediately saves the current state. /// Note that this will be a no-op if there is a change in progress via . /// void SaveState(); /// /// Restores an older or newer state. /// /// The direction to restore in. If less than 0, an older state will be used. If greater than 0, a newer state will be used. void RestoreState(int direction); } }