2021-08-17 13:39:08 +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.Linq;
|
|
|
|
using NUnit.Framework;
|
2021-11-13 00:53:19 +08:00
|
|
|
using osu.Framework.Screens;
|
2021-08-17 13:39:08 +08:00
|
|
|
using osu.Framework.Testing;
|
2021-11-13 00:53:19 +08:00
|
|
|
using osu.Game.Online.Multiplayer;
|
2021-12-10 19:08:59 +08:00
|
|
|
using osu.Game.Online.Rooms;
|
2021-08-17 13:39:08 +08:00
|
|
|
using osu.Game.Rulesets.Osu;
|
|
|
|
using osu.Game.Screens.OnlinePlay.Multiplayer;
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.Multiplayer
|
|
|
|
{
|
|
|
|
public class TestSceneMultiplayerPlayer : MultiplayerTestScene
|
|
|
|
{
|
|
|
|
private MultiplayerPlayer player;
|
|
|
|
|
|
|
|
[SetUpSteps]
|
|
|
|
public override void SetUpSteps()
|
|
|
|
{
|
|
|
|
base.SetUpSteps();
|
|
|
|
|
|
|
|
AddStep("set beatmap", () =>
|
|
|
|
{
|
|
|
|
Beatmap.Value = CreateWorkingBeatmap(new OsuRuleset().RulesetInfo);
|
|
|
|
});
|
|
|
|
|
|
|
|
AddStep("initialise gameplay", () =>
|
|
|
|
{
|
2022-02-15 22:33:26 +08:00
|
|
|
Stack.Push(player = new MultiplayerPlayer(Client.APIRoom, new PlaylistItem(Beatmap.Value.BeatmapInfo)
|
2021-12-10 19:08:59 +08:00
|
|
|
{
|
2022-02-15 15:01:14 +08:00
|
|
|
RulesetID = Beatmap.Value.BeatmapInfo.Ruleset.OnlineID,
|
2021-12-10 19:08:59 +08:00
|
|
|
}, Client.Room?.Users.ToArray()));
|
2021-08-17 13:39:08 +08:00
|
|
|
});
|
2021-11-13 00:53:19 +08:00
|
|
|
|
|
|
|
AddUntilStep("wait for player to be current", () => player.IsCurrentScreen() && player.IsLoaded);
|
|
|
|
AddStep("start gameplay", () => ((IMultiplayerClient)Client).MatchStarted());
|
2021-08-17 13:39:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void TestGameplay()
|
|
|
|
{
|
|
|
|
AddUntilStep("wait for gameplay start", () => player.LocalUserPlaying.Value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|