mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 12:02:54 +08:00
Tidy up base implementation
This commit is contained in:
parent
b52f070fdb
commit
6a61fd95eb
@ -28,10 +28,15 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
public abstract class MultiplayerGameplayLeaderboardTestScene : OsuTestScene
|
||||
{
|
||||
protected readonly BindableList<MultiplayerRoomUser> MultiplayerUsers = new BindableList<MultiplayerRoomUser>();
|
||||
private readonly BindableList<int> multiplayerUserIds = new BindableList<int>();
|
||||
|
||||
protected MultiplayerGameplayLeaderboard Leaderboard { get; private set; }
|
||||
|
||||
protected virtual MultiplayerRoomUser CreateUser(int userId) => new MultiplayerRoomUser(userId);
|
||||
|
||||
protected abstract MultiplayerGameplayLeaderboard CreateLeaderboard(OsuScoreProcessor scoreProcessor);
|
||||
|
||||
private readonly BindableList<int> multiplayerUserIds = new BindableList<int>();
|
||||
|
||||
private OsuConfigManager config;
|
||||
|
||||
private readonly Mock<SpectatorClient> spectatorClient = new Mock<SpectatorClient>();
|
||||
@ -81,7 +86,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
AddStep("set local user", () => ((DummyAPIAccess)API).LocalUser.Value = new APIUser
|
||||
{
|
||||
Username = "local",
|
||||
Id = 1,
|
||||
});
|
||||
|
||||
AddStep("populate users", () =>
|
||||
@ -95,25 +100,19 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
Leaderboard?.Expire();
|
||||
|
||||
OsuScoreProcessor scoreProcessor;
|
||||
Beatmap.Value = CreateWorkingBeatmap(Ruleset.Value);
|
||||
|
||||
var playableBeatmap = Beatmap.Value.GetPlayableBeatmap(Ruleset.Value);
|
||||
|
||||
Child = scoreProcessor = new OsuScoreProcessor();
|
||||
|
||||
OsuScoreProcessor scoreProcessor = new OsuScoreProcessor();
|
||||
scoreProcessor.ApplyBeatmap(playableBeatmap);
|
||||
|
||||
Child = scoreProcessor;
|
||||
|
||||
LoadComponentAsync(Leaderboard = CreateLeaderboard(scoreProcessor), Add);
|
||||
});
|
||||
|
||||
AddUntilStep("wait for load", () => Leaderboard.IsLoaded);
|
||||
}
|
||||
|
||||
protected virtual MultiplayerRoomUser CreateUser(int i) => new MultiplayerRoomUser(i);
|
||||
|
||||
protected abstract MultiplayerGameplayLeaderboard CreateLeaderboard(OsuScoreProcessor scoreProcessor);
|
||||
|
||||
[Test]
|
||||
public void TestScoreUpdates()
|
||||
{
|
||||
|
@ -14,9 +14,9 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
public class TestSceneMultiplayerGameplayLeaderboardTeams : MultiplayerGameplayLeaderboardTestScene
|
||||
{
|
||||
protected override MultiplayerRoomUser CreateUser(int i)
|
||||
protected override MultiplayerRoomUser CreateUser(int userId)
|
||||
{
|
||||
var user = base.CreateUser(i);
|
||||
var user = base.CreateUser(userId);
|
||||
user.MatchState = new TeamVersusUserState
|
||||
{
|
||||
TeamID = RNG.Next(0, 2)
|
||||
|
Loading…
Reference in New Issue
Block a user