// 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.Framework.Bindables; using osu.Game.Online.Rooms; #nullable enable namespace osu.Game.Screens.OnlinePlay { [Cached(typeof(IRoomManager))] public interface IRoomManager { /// /// Invoked when the s have been updated. /// event Action RoomsUpdated; /// /// Whether an initial listing of rooms has been received. /// IBindable InitialRoomsReceived { get; } /// /// All the active s. /// IBindableList Rooms { get; } /// /// Creates a new . /// /// The to create. /// An action to be invoked if the creation succeeds. /// An action to be invoked if an error occurred. void CreateRoom(Room room, Action? onSuccess = null, Action? onError = null); /// /// Joins a . /// /// The to join. must be populated. /// An optional password to use for the join operation. /// /// void JoinRoom(Room room, string? password = null, Action? onSuccess = null, Action? onError = null); /// /// Parts the currently-joined . /// void PartRoom(); } }