1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 17:02:55 +08:00
osu-lazer/osu.Game/Tests/Visual/Multiplayer/TestMultiplayerRoomManager.cs

31 lines
1.2 KiB
C#
Raw Normal View History

2020-12-19 00:17:24 +08: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.
using System.Collections.Generic;
using osu.Framework.Allocation;
2020-12-25 12:38:11 +08:00
using osu.Game.Online.Rooms;
2021-06-25 17:02:53 +08:00
using osu.Game.Screens.OnlinePlay.Components;
using osu.Game.Screens.OnlinePlay.Multiplayer;
using osu.Game.Tests.Visual.OnlinePlay;
2020-12-19 00:17:24 +08:00
2020-12-25 12:38:11 +08:00
namespace osu.Game.Tests.Visual.Multiplayer
2020-12-19 00:17:24 +08:00
{
2021-06-25 17:02:53 +08:00
/// <summary>
2021-10-27 15:10:22 +08:00
/// A <see cref="RoomManager"/> for use in multiplayer test scenes.
/// Should generally not be used by itself outside of a <see cref="MultiplayerTestScene"/>.
2021-06-25 17:02:53 +08:00
/// </summary>
2021-10-27 15:10:22 +08:00
public class TestMultiplayerRoomManager : MultiplayerRoomManager
2020-12-19 00:17:24 +08:00
{
2021-10-27 15:10:22 +08:00
[Resolved]
private TestRoomRequestsHandler requestsHandler { get; set; }
2020-12-19 00:17:24 +08:00
2021-10-27 15:10:22 +08:00
public IReadOnlyList<Room> ServerSideRooms => requestsHandler.ServerSideRooms;
2020-12-19 00:17:24 +08:00
/// <summary>
/// Adds a room to a local "server-side" list that's returned when a <see cref="GetRoomsRequest"/> is fired.
/// </summary>
/// <param name="room">The room.</param>
2021-10-27 15:10:22 +08:00
public void AddServerSideRoom(Room room) => requestsHandler.AddServerSideRoom(room);
2020-12-19 00:17:24 +08:00
}
}