2018-12-25 10:45:50 +08:00
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using osu.Framework.Configuration;
|
|
|
|
using osu.Game.Online.Multiplayer;
|
|
|
|
using osu.Game.Screens.Multi.Lounge.Components;
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Multi
|
|
|
|
{
|
|
|
|
public interface IRoomManager
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// All the active <see cref="Room"/>s.
|
|
|
|
/// </summary>
|
|
|
|
IBindableCollection<Room> Rooms { get; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Creates a new <see cref="Room"/>.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="room">The <see cref="Room"/> to create.</param>
|
2018-12-26 19:45:56 +08:00
|
|
|
/// <param name="onSuccess">An action to be invoked if the creation succeeds.</param>
|
2018-12-26 17:38:58 +08:00
|
|
|
/// <param name="onError">An action to be invoked if an error occurred.</param>
|
2018-12-26 20:10:31 +08:00
|
|
|
void CreateRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null);
|
2018-12-25 10:45:50 +08: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 20:10:31 +08:00
|
|
|
/// <param name="onSuccess"></param>
|
|
|
|
/// <param name="onError"></param>
|
|
|
|
void JoinRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null);
|
2018-12-25 10:45:50 +08:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Parts the currently-joined <see cref="Room"/>.
|
|
|
|
/// </summary>
|
|
|
|
void PartRoom();
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Queries for <see cref="Room"/>s matching a new <see cref="FilterCriteria"/>.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="criteria">The <see cref="FilterCriteria"/> to match.</param>
|
|
|
|
void Filter(FilterCriteria criteria);
|
|
|
|
}
|
|
|
|
}
|