2021-08-09 15:50:25 +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 osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Utils;
|
2021-08-12 10:08:52 +08:00
|
|
|
using osu.Game.Online.Multiplayer;
|
2021-08-09 15:50:25 +08:00
|
|
|
using osu.Game.Online.Multiplayer.MatchTypes.TeamVersus;
|
|
|
|
using osu.Game.Rulesets.Osu.Scoring;
|
2021-08-09 17:13:28 +08:00
|
|
|
using osu.Game.Screens.OnlinePlay.Multiplayer;
|
2021-08-09 15:50:25 +08:00
|
|
|
using osu.Game.Screens.Play.HUD;
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.Multiplayer
|
|
|
|
{
|
2022-04-11 18:15:57 +08:00
|
|
|
public class TestSceneMultiplayerGameplayLeaderboardTeams : MultiplayerGameplayLeaderboardTestScene
|
2021-08-09 15:50:25 +08:00
|
|
|
{
|
2022-04-11 18:15:57 +08:00
|
|
|
protected override MultiplayerRoomUser CreateUser(int i)
|
2021-08-09 15:50:25 +08:00
|
|
|
{
|
2022-04-11 18:15:57 +08:00
|
|
|
var user = base.CreateUser(i);
|
|
|
|
user.MatchState = new TeamVersusUserState
|
|
|
|
{
|
|
|
|
TeamID = RNG.Next(0, 2)
|
|
|
|
};
|
|
|
|
return user;
|
2021-08-09 15:50:25 +08:00
|
|
|
}
|
|
|
|
|
2022-04-11 18:15:57 +08:00
|
|
|
protected override MultiplayerGameplayLeaderboard CreateLeaderboard(OsuScoreProcessor scoreProcessor) =>
|
|
|
|
new MultiplayerGameplayLeaderboard(Ruleset.Value, scoreProcessor, MultiplayerUsers.ToArray())
|
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
};
|
2021-08-09 15:50:25 +08:00
|
|
|
|
|
|
|
public override void SetUpSteps()
|
|
|
|
{
|
2021-10-27 19:56:03 +08:00
|
|
|
base.SetUpSteps();
|
|
|
|
|
2022-04-11 18:15:57 +08:00
|
|
|
AddStep("Add external display components", () =>
|
2021-08-09 15:50:25 +08:00
|
|
|
{
|
2022-04-11 18:15:57 +08:00
|
|
|
LoadComponentAsync(new MatchScoreDisplay
|
2021-08-09 15:50:25 +08:00
|
|
|
{
|
2022-04-11 18:15:57 +08:00
|
|
|
Team1Score = { BindTarget = Leaderboard.TeamScores[0] },
|
|
|
|
Team2Score = { BindTarget = Leaderboard.TeamScores[1] }
|
|
|
|
}, Add);
|
2021-08-09 15:50:25 +08:00
|
|
|
|
2022-04-11 18:15:57 +08:00
|
|
|
LoadComponentAsync(new GameplayMatchScoreDisplay
|
2021-08-09 15:50:25 +08:00
|
|
|
{
|
2022-04-11 18:15:57 +08:00
|
|
|
Anchor = Anchor.BottomCentre,
|
|
|
|
Origin = Anchor.BottomCentre,
|
|
|
|
Team1Score = { BindTarget = Leaderboard.TeamScores[0] },
|
|
|
|
Team2Score = { BindTarget = Leaderboard.TeamScores[1] }
|
|
|
|
}, Add);
|
2021-08-09 17:13:28 +08:00
|
|
|
});
|
2021-08-09 15:50:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|