mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 14:46:38 +09:00
Handle beatmap lookup requests in TestRoomRequestsHandler
This commit is contained in:
@ -8,6 +8,7 @@ using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Screens.OnlinePlay;
|
||||
@ -33,9 +34,6 @@ namespace osu.Game.Tests.Visual.OnlinePlay
|
||||
|
||||
protected override Container<Drawable> Content => content;
|
||||
|
||||
[Resolved]
|
||||
private OsuGameBase game { get; set; }
|
||||
|
||||
private readonly Container content;
|
||||
private readonly Container drawableDependenciesContainer;
|
||||
private DelegatedDependencyContainer dependencies;
|
||||
@ -71,7 +69,12 @@ namespace osu.Game.Tests.Visual.OnlinePlay
|
||||
AddStep("setup API", () =>
|
||||
{
|
||||
var handler = OnlinePlayDependencies.RequestsHandler;
|
||||
((DummyAPIAccess)API).HandleRequest = request => handler.HandleRequest(request, API.LocalUser.Value, game);
|
||||
|
||||
// Resolving the BeatmapManager in the test scene will inject the game-wide BeatmapManager, while many test scenes cache their own BeatmapManager instead.
|
||||
// To get around this, the BeatmapManager is looked up from the dependencies provided to the children of the test scene instead.
|
||||
var beatmapManager = dependencies.Get<BeatmapManager>();
|
||||
|
||||
((DummyAPIAccess)API).HandleRequest = request => handler.HandleRequest(request, API.LocalUser.Value, beatmapManager);
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user