mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 22:56:36 +09:00
Create IRoomManager interface, add test for RoomsContainer
This commit is contained in:
46
osu.Game/Screens/Multi/IRoomManager.cs
Normal file
46
osu.Game/Screens/Multi/IRoomManager.cs
Normal file
@ -0,0 +1,46 @@
|
||||
// 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>
|
||||
/// Invoked when this <see cref="IRoomManager"/> requests a <see cref="Room"/> to be opened.
|
||||
/// </summary>
|
||||
event Action<Room> OpenRequested;
|
||||
|
||||
/// <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>
|
||||
void CreateRoom(Room room);
|
||||
|
||||
/// <summary>
|
||||
/// Joins a <see cref="Room"/>.
|
||||
/// </summary>
|
||||
/// <param name="room">The <see cref="Room"/> to join. <see cref="Room.RoomID"/> must be populated.</param>
|
||||
void JoinRoom(Room room);
|
||||
|
||||
/// <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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user