// 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; namespace osu.Game.Screens.OnlinePlay { [Cached(typeof(IRoomManager))] public interface IRoomManager { /// /// Invoked when the s have been updated. /// event Action RoomsUpdated; /// /// All the active s. /// IBindableList Rooms { get; } /// /// Adds a to this . /// If already existing, the local room will be updated with the given one. /// /// The incoming . void AddOrUpdateRoom(Room room); /// /// Removes a from this . /// /// The to remove. void RemoveRoom(Room room); /// /// Removes all s from this . /// void ClearRooms(); /// /// 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(); } }