// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. #nullable disable using System; using System.Collections.Generic; using osu.Framework.Allocation; using osu.Framework.Screens; using osu.Game.Screens.Menu; namespace osu.Game.Screens { /// /// Manages a global screen stack to allow nested components a guarantee of where work is executed. /// [Cached] public interface IPerformFromScreenRunner { /// /// Perform an action only after returning to a specific screen as indicated by . /// Eagerly tries to exit the current screen until it succeeds. /// /// The action to perform once we are in the correct state. /// An optional collection of valid screen types. If any of these screens are already current we can perform the action immediately, else the first valid parent will be made current before performing the action. is used if not specified. void PerformFromScreen(Action action, IEnumerable validScreens = null); } }