+ /// An loadable into s via ,
+ /// which provides dependencies for and loads an isolated screen.
+ ///
+ /// This screen:
+ ///
+ /// - Provides a to be resolved as a dependency in the screen,
+ /// which is typically a part of .
+ /// - Rebinds the to handle requests via a .
+ /// - Provides a for the screen.
+ ///
+ ///
+ ///
+ public class TestMultiplayerScreenStack : OsuScreen
+ {
+ public Screens.OnlinePlay.Multiplayer.Multiplayer MultiplayerScreen => multiplayerScreen;
+
+ public TestMultiplayerRoomManager RoomManager => multiplayerScreen.RoomManager;
+
+ public IScreen CurrentScreen => screenStack.CurrentScreen;
+
+ public new bool IsLoaded => base.IsLoaded && MultiplayerScreen.IsLoaded;
+
+ [Cached(typeof(MultiplayerClient))]
+ public readonly TestMultiplayerClient Client;
+
+ private readonly OsuScreenStack screenStack;
+ private readonly TestMultiplayer multiplayerScreen;
+
+ public TestMultiplayerScreenStack()
+ {
+ multiplayerScreen = new TestMultiplayer();
+
+ InternalChildren = new Drawable[]
+ {
+ Client = new TestMultiplayerClient(RoomManager),
+ screenStack = new OsuScreenStack { RelativeSizeAxes = Axes.Both }
+ };
+
+ screenStack.Push(multiplayerScreen);
+ }
+
+ [BackgroundDependencyLoader]
+ private void load(IAPIProvider api, OsuGameBase game)
+ {
+ ((DummyAPIAccess)api).HandleRequest = request => multiplayerScreen.RequestsHandler.HandleRequest(request, api.LocalUser.Value, game);
+ }
+
+ public override bool OnBackButton() => multiplayerScreen.OnBackButton();
+
+ public override bool OnExiting(IScreen next)
+ {
+ if (screenStack.CurrentScreen == null)
+ return base.OnExiting(next);
+
+ screenStack.Exit();
+ return true;
+ }
+
+ private class TestMultiplayer : Screens.OnlinePlay.Multiplayer.Multiplayer
+ {
+ public new TestMultiplayerRoomManager RoomManager { get; private set; }
+ public TestRoomRequestsHandler RequestsHandler { get; private set; }
+
+ protected override RoomManager CreateRoomManager() => RoomManager = new TestMultiplayerRoomManager(RequestsHandler = new TestRoomRequestsHandler());
+ }
+ }
+}
diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneBeatmapListingSearchControl.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneBeatmapListingSearchControl.cs
index a9fe7ed7d8..f17de75f5c 100644
--- a/osu.Game.Tests/Visual/UserInterface/TestSceneBeatmapListingSearchControl.cs
+++ b/osu.Game.Tests/Visual/UserInterface/TestSceneBeatmapListingSearchControl.cs
@@ -110,25 +110,19 @@ namespace osu.Game.Tests.Visual.UserInterface
base.Dispose(isDisposing);
}
- private static readonly BeatmapSetInfo beatmap_set = new BeatmapSetInfo
+ private static readonly APIBeatmapSet beatmap_set = new APIBeatmapSet
{
- OnlineInfo = new APIBeatmapSet
+ Covers = new BeatmapSetOnlineCovers
{
- Covers = new BeatmapSetOnlineCovers
- {
- Cover = "https://assets.ppy.sh/beatmaps/1094296/covers/cover@2x.jpg?1581416305"
- }
+ Cover = "https://assets.ppy.sh/beatmaps/1094296/covers/cover@2x.jpg?1581416305"
}
};
- private static readonly BeatmapSetInfo no_cover_beatmap_set = new BeatmapSetInfo
+ private static readonly APIBeatmapSet no_cover_beatmap_set = new APIBeatmapSet
{
- OnlineInfo = new APIBeatmapSet
+ Covers = new BeatmapSetOnlineCovers
{
- Covers = new BeatmapSetOnlineCovers
- {
- Cover = string.Empty
- }
+ Cover = string.Empty
}
};
}
diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneBreadcrumbControlHeader.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneBreadcrumbControlHeader.cs
index 90c3e142df..7bc75f1c44 100644
--- a/osu.Game.Tests/Visual/UserInterface/TestSceneBreadcrumbControlHeader.cs
+++ b/osu.Game.Tests/Visual/UserInterface/TestSceneBreadcrumbControlHeader.cs
@@ -31,18 +31,18 @@ namespace osu.Game.Tests.Visual.UserInterface
[Test]
public void TestAddAndRemoveItem()
{
- foreach (var item in items.Skip(1))
+ foreach (string item in items.Skip(1))
AddStep($"Add {item} item", () => header.AddItem(item));
- foreach (var item in items.Reverse().SkipLast(3))
+ foreach (string item in items.Reverse().SkipLast(3))
AddStep($"Remove {item} item", () => header.RemoveItem(item));
AddStep("Clear items", () => header.ClearItems());
- foreach (var item in items)
+ foreach (string item in items)
AddStep($"Add {item} item", () => header.AddItem(item));
- foreach (var item in items)
+ foreach (string item in items)
AddStep($"Remove {item} item", () => header.RemoveItem(item));
}
diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneDashboardBeatmapListing.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneDashboardBeatmapListing.cs
index 6727c7560b..06c64a566e 100644
--- a/osu.Game.Tests/Visual/UserInterface/TestSceneDashboardBeatmapListing.cs
+++ b/osu.Game.Tests/Visual/UserInterface/TestSceneDashboardBeatmapListing.cs
@@ -56,95 +56,71 @@ namespace osu.Game.Tests.Visual.UserInterface
AddStep("Set width to 300", () => content.ResizeWidthTo(300, 500));
}
- private static readonly List