2021-06-25 12:02:19 +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.
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
#nullable disable
|
|
|
|
|
2021-06-25 12:02:19 +08:00
|
|
|
using osu.Game.Online.Multiplayer;
|
2021-06-25 16:55:16 +08:00
|
|
|
using osu.Game.Online.Spectator;
|
2021-06-25 12:02:19 +08:00
|
|
|
using osu.Game.Screens.OnlinePlay;
|
|
|
|
using osu.Game.Tests.Visual.OnlinePlay;
|
2021-06-25 16:55:16 +08:00
|
|
|
using osu.Game.Tests.Visual.Spectator;
|
2021-06-25 12:02:19 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.Multiplayer
|
|
|
|
{
|
2021-06-25 17:02:53 +08:00
|
|
|
/// <summary>
|
|
|
|
/// Contains the basic dependencies of multiplayer test scenes.
|
|
|
|
/// </summary>
|
2021-06-25 19:15:30 +08:00
|
|
|
public class MultiplayerTestSceneDependencies : OnlinePlayTestSceneDependencies, IMultiplayerTestSceneDependencies
|
2021-06-25 12:02:19 +08:00
|
|
|
{
|
2022-02-16 08:43:28 +08:00
|
|
|
public TestMultiplayerClient MultiplayerClient { get; }
|
2021-06-25 16:55:16 +08:00
|
|
|
public TestSpectatorClient SpectatorClient { get; }
|
2021-10-27 15:10:22 +08:00
|
|
|
public new TestMultiplayerRoomManager RoomManager => (TestMultiplayerRoomManager)base.RoomManager;
|
2021-06-25 12:02:19 +08:00
|
|
|
|
2021-06-25 19:11:38 +08:00
|
|
|
public MultiplayerTestSceneDependencies()
|
2021-06-25 12:02:19 +08:00
|
|
|
{
|
2022-02-16 08:43:28 +08:00
|
|
|
MultiplayerClient = new TestMultiplayerClient(RoomManager);
|
2021-06-25 16:55:16 +08:00
|
|
|
SpectatorClient = CreateSpectatorClient();
|
2021-06-25 16:37:02 +08:00
|
|
|
|
2022-02-16 08:43:28 +08:00
|
|
|
CacheAs<MultiplayerClient>(MultiplayerClient);
|
2021-06-25 16:55:16 +08:00
|
|
|
CacheAs<SpectatorClient>(SpectatorClient);
|
2021-06-25 12:02:19 +08:00
|
|
|
}
|
|
|
|
|
2021-10-28 13:29:49 +08:00
|
|
|
protected override IRoomManager CreateRoomManager() => new TestMultiplayerRoomManager(RequestsHandler);
|
2021-06-25 16:55:16 +08:00
|
|
|
|
|
|
|
protected virtual TestSpectatorClient CreateSpectatorClient() => new TestSpectatorClient();
|
2021-06-25 12:02:19 +08:00
|
|
|
}
|
|
|
|
}
|