2021-08-11 13:43:16 +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-08-11 13:43:16 +08:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using osu.Framework.Bindables;
|
|
|
|
using osu.Game.Online.Rooms;
|
|
|
|
using osu.Game.Rulesets.Osu;
|
|
|
|
using osu.Game.Screens.OnlinePlay.Multiplayer;
|
2021-12-13 15:50:29 +08:00
|
|
|
using osu.Game.Tests.Resources;
|
2022-05-08 21:00:07 +08:00
|
|
|
using osuTK;
|
2021-08-11 13:43:16 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.Multiplayer
|
|
|
|
{
|
|
|
|
public class TestSceneMultiplayerTeamResults : ScreenTestScene
|
|
|
|
{
|
2022-05-08 21:00:07 +08:00
|
|
|
[Test]
|
|
|
|
public void TestScaling()
|
|
|
|
{
|
|
|
|
// scheduling is needed as scaling the content immediately causes the entire scene to shake badly, for some odd reason.
|
|
|
|
AddSliderStep("scale", 0.5f, 1.6f, 1f, v => Schedule(() =>
|
|
|
|
{
|
|
|
|
Stack.Scale = new Vector2(v);
|
|
|
|
Stack.Size = new Vector2(1f / v);
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
|
2021-08-13 02:21:53 +08:00
|
|
|
[TestCase(7483253, 1048576)]
|
|
|
|
[TestCase(1048576, 7483253)]
|
2021-08-13 02:38:24 +08:00
|
|
|
[TestCase(1048576, 1048576)]
|
2021-08-14 03:30:26 +08:00
|
|
|
public void TestDisplayTeamResults(int team1Score, int team2Score)
|
2021-08-11 13:43:16 +08:00
|
|
|
{
|
2021-08-13 01:48:57 +08:00
|
|
|
MultiplayerResultsScreen screen = null;
|
|
|
|
|
2021-08-11 13:43:16 +08:00
|
|
|
AddStep("show results screen", () =>
|
|
|
|
{
|
|
|
|
var rulesetInfo = new OsuRuleset().RulesetInfo;
|
|
|
|
var beatmapInfo = CreateBeatmap(rulesetInfo).BeatmapInfo;
|
2021-12-13 15:50:29 +08:00
|
|
|
var score = TestResources.CreateTestScoreInfo(beatmapInfo);
|
2021-08-11 13:43:16 +08:00
|
|
|
|
2022-04-12 13:13:07 +08:00
|
|
|
SortedDictionary<int, BindableLong> teamScores = new SortedDictionary<int, BindableLong>
|
2021-08-11 13:43:16 +08:00
|
|
|
{
|
2022-04-12 13:13:07 +08:00
|
|
|
{ 0, new BindableLong(team1Score) },
|
|
|
|
{ 1, new BindableLong(team2Score) }
|
2021-08-11 13:43:16 +08:00
|
|
|
};
|
|
|
|
|
2022-02-15 22:33:26 +08:00
|
|
|
Stack.Push(screen = new MultiplayerTeamResultsScreen(score, 1, new PlaylistItem(beatmapInfo), teamScores));
|
2021-08-11 13:43:16 +08:00
|
|
|
});
|
2021-08-13 01:48:57 +08:00
|
|
|
|
|
|
|
AddUntilStep("wait for loaded", () => screen.IsLoaded);
|
2021-08-11 13:43:16 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|