2020-12-21 09:42:31 +00: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-03-03 12:54:34 +00:00
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Game.Online.Multiplayer;
|
2020-12-25 15:50:00 +00:00
|
|
|
using osu.Game.Screens.OnlinePlay.Components;
|
2020-12-21 09:42:31 +00:00
|
|
|
|
2020-12-25 04:20:37 +00:00
|
|
|
namespace osu.Game.Tests.Visual.Multiplayer
|
2020-12-21 09:42:31 +00:00
|
|
|
{
|
2021-03-03 12:54:34 +00:00
|
|
|
public class TestSceneMultiplayer : ScreenTestScene
|
2020-12-21 09:42:31 +00:00
|
|
|
{
|
2021-03-03 13:07:39 +00:00
|
|
|
private TestMultiplayer multiplayerScreen;
|
|
|
|
|
2020-12-25 04:38:11 +00:00
|
|
|
public TestSceneMultiplayer()
|
2020-12-21 09:42:31 +00:00
|
|
|
{
|
2021-03-03 13:07:39 +00:00
|
|
|
AddStep("show", () =>
|
|
|
|
{
|
|
|
|
multiplayerScreen = new TestMultiplayer();
|
|
|
|
|
|
|
|
// Needs to be added at a higher level since the multiplayer screen becomes non-current.
|
|
|
|
Child = multiplayerScreen.Client;
|
|
|
|
|
|
|
|
LoadScreen(multiplayerScreen);
|
|
|
|
});
|
2020-12-21 09:42:31 +00:00
|
|
|
|
2021-03-03 13:07:39 +00:00
|
|
|
AddUntilStep("wait for loaded", () => multiplayerScreen.IsLoaded);
|
2020-12-21 09:42:31 +00:00
|
|
|
}
|
|
|
|
|
2021-03-03 12:54:34 +00:00
|
|
|
private class TestMultiplayer : Screens.OnlinePlay.Multiplayer.Multiplayer
|
2020-12-23 20:00:47 +00:00
|
|
|
{
|
2021-03-03 12:54:34 +00:00
|
|
|
[Cached(typeof(StatefulMultiplayerClient))]
|
|
|
|
public readonly TestMultiplayerClient Client;
|
2020-12-23 20:00:47 +00:00
|
|
|
|
2021-03-03 12:54:34 +00:00
|
|
|
public TestMultiplayer()
|
|
|
|
{
|
2021-03-03 13:07:39 +00:00
|
|
|
Client = new TestMultiplayerClient((TestMultiplayerRoomManager)RoomManager);
|
2021-03-03 12:54:34 +00:00
|
|
|
}
|
2020-12-23 20:00:47 +00:00
|
|
|
|
2020-12-25 04:38:11 +00:00
|
|
|
protected override RoomManager CreateRoomManager() => new TestMultiplayerRoomManager();
|
2020-12-21 09:42:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|