1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:32:57 +08:00

Remove CachedModelDependencyContainer usages from online play

This commit is contained in:
Dan Balasescu 2024-11-15 13:22:03 +09:00
parent bfbae9458a
commit 1a656d0ec3
No known key found for this signature in database
8 changed files with 1 additions and 43 deletions

View File

@ -26,11 +26,6 @@ namespace osu.Game.Tests.Visual.DailyChallenge
private readonly Bindable<Room> room = new Bindable<Room>(new Room());
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) => new CachedModelDependencyContainer<Room>(base.CreateChildDependencies(parent))
{
Model = { BindTarget = room }
};
[Test]
public void TestBasicAppearance()
{

View File

@ -18,11 +18,6 @@ namespace osu.Game.Tests.Visual.DailyChallenge
{
private readonly Bindable<Room> room = new Bindable<Room>(new Room());
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) => new CachedModelDependencyContainer<Room>(base.CreateChildDependencies(parent))
{
Model = { BindTarget = room }
};
[Cached]
private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Plum);

View File

@ -43,9 +43,6 @@ namespace osu.Game.Tests.Visual.Multiplayer
private OsuButton readyButton => control.ChildrenOfType<OsuButton>().Single();
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) =>
new CachedModelDependencyContainer<Room>(base.CreateChildDependencies(parent)) { Model = { BindTarget = room } };
[BackgroundDependencyLoader]
private void load()
{

View File

@ -9,7 +9,6 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Multiplayer;
using osu.Game.Online.Rooms;
using osu.Game.Screens.OnlinePlay.Lounge.Components;
namespace osu.Game.Tests.Visual.Multiplayer
@ -18,10 +17,6 @@ namespace osu.Game.Tests.Visual.Multiplayer
{
private readonly Mock<MultiplayerClient> multiplayerClient = new Mock<MultiplayerClient>();
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) =>
// not used directly in component, but required due to it inheriting from OnlinePlayComposite.
new CachedModelDependencyContainer<Room>(base.CreateChildDependencies(parent));
[BackgroundDependencyLoader]
private void load()
{

View File

@ -119,14 +119,6 @@ namespace osu.Game.Screens.OnlinePlay.DailyChallenge
Padding = new MarginPadding { Horizontal = -HORIZONTAL_OVERFLOW_PADDING };
}
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
{
return new CachedModelDependencyContainer<Room>(base.CreateChildDependencies(parent))
{
Model = { Value = room }
};
}
[BackgroundDependencyLoader]
private void load(AudioManager audio)
{

View File

@ -316,14 +316,6 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
passwordIcon.Alpha = Room.HasPassword ? 1 : 0;
}
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
{
return new CachedModelDependencyContainer<Room>(base.CreateChildDependencies(parent))
{
Model = { Value = Room }
};
}
private int numberOfAvatars = 7;
public int NumberOfAvatars

View File

@ -287,14 +287,6 @@ namespace osu.Game.Screens.OnlinePlay.Match
}
}
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
{
return new CachedModelDependencyContainer<Room>(base.CreateChildDependencies(parent))
{
Model = { Value = Room }
};
}
protected virtual bool IsConnected => api.State.Value == APIState.Online;
public override bool OnBackButton()

View File

@ -44,7 +44,7 @@ namespace osu.Game.Tests.Visual.OnlinePlay
UserLookupCache = new TestUserLookupCache();
BeatmapLookupCache = new BeatmapLookupCache();
dependencies = new DependencyContainer(new CachedModelDependencyContainer<Room>(null) { Model = { BindTarget = SelectedRoom } });
dependencies = new DependencyContainer();
CacheAs(RequestsHandler);
CacheAs(SelectedRoom);