2019-01-24 08:43:03 +00:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-12-25 02:45:50 +00:00
|
|
|
|
|
|
|
using System;
|
2019-02-21 10:04:31 +00:00
|
|
|
using osu.Framework.Bindables;
|
2018-12-25 02:45:50 +00:00
|
|
|
using osu.Game.Online.Multiplayer;
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Multi
|
|
|
|
{
|
|
|
|
public interface IRoomManager
|
|
|
|
{
|
2018-12-27 16:45:19 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Invoked when the <see cref="Room"/>s have been updated.
|
|
|
|
/// </summary>
|
|
|
|
event Action RoomsUpdated;
|
|
|
|
|
2020-06-05 11:52:27 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Whether an initial listing of rooms has been received.
|
|
|
|
/// </summary>
|
|
|
|
Bindable<bool> InitialRoomsReceived { get; }
|
|
|
|
|
2018-12-25 02:45:50 +00:00
|
|
|
/// <summary>
|
|
|
|
/// All the active <see cref="Room"/>s.
|
|
|
|
/// </summary>
|
2019-01-07 09:50:27 +00:00
|
|
|
IBindableList<Room> Rooms { get; }
|
2018-12-25 02:45:50 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Creates a new <see cref="Room"/>.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="room">The <see cref="Room"/> to create.</param>
|
2018-12-26 11:45:56 +00:00
|
|
|
/// <param name="onSuccess">An action to be invoked if the creation succeeds.</param>
|
2018-12-26 09:38:58 +00:00
|
|
|
/// <param name="onError">An action to be invoked if an error occurred.</param>
|
2018-12-26 12:10:31 +00:00
|
|
|
void CreateRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null);
|
2018-12-25 02:45:50 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Joins a <see cref="Room"/>.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="room">The <see cref="Room"/> to join. <see cref="Room.RoomID"/> must be populated.</param>
|
2018-12-26 12:10:31 +00:00
|
|
|
/// <param name="onSuccess"></param>
|
|
|
|
/// <param name="onError"></param>
|
|
|
|
void JoinRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null);
|
2018-12-25 02:45:50 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Parts the currently-joined <see cref="Room"/>.
|
|
|
|
/// </summary>
|
|
|
|
void PartRoom();
|
|
|
|
}
|
|
|
|
}
|