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.
|
|
|
|
|
2021-06-25 16:37:02 +08:00
|
|
|
using osu.Game.Database;
|
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
|
|
|
{
|
|
|
|
public TestMultiplayerClient Client { get; }
|
2021-06-25 16:37:02 +08:00
|
|
|
public TestUserLookupCache LookupCache { get; }
|
2021-06-25 16:55:16 +08:00
|
|
|
public TestSpectatorClient SpectatorClient { get; }
|
2021-07-26 14:47:13 +08:00
|
|
|
public new TestRequestHandlingMultiplayerRoomManager RoomManager => (TestRequestHandlingMultiplayerRoomManager)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
|
|
|
{
|
|
|
|
Client = new TestMultiplayerClient(RoomManager);
|
2021-06-25 16:37:02 +08:00
|
|
|
LookupCache = new TestUserLookupCache();
|
2021-06-25 16:55:16 +08:00
|
|
|
SpectatorClient = CreateSpectatorClient();
|
2021-06-25 16:37:02 +08:00
|
|
|
|
2021-06-25 12:02:19 +08:00
|
|
|
CacheAs<MultiplayerClient>(Client);
|
2021-06-25 16:37:02 +08:00
|
|
|
CacheAs<UserLookupCache>(LookupCache);
|
2021-06-25 16:55:16 +08:00
|
|
|
CacheAs<SpectatorClient>(SpectatorClient);
|
2021-06-25 12:02:19 +08:00
|
|
|
}
|
|
|
|
|
2021-07-26 14:47:13 +08:00
|
|
|
protected override IRoomManager CreateRoomManager() => new TestRequestHandlingMultiplayerRoomManager();
|
2021-06-25 16:55:16 +08:00
|
|
|
|
|
|
|
protected virtual TestSpectatorClient CreateSpectatorClient() => new TestSpectatorClient();
|
2021-06-25 12:02:19 +08:00
|
|
|
}
|
|
|
|
}
|