mirror of
https://github.com/ppy/osu
synced 2025-01-02 20:32:10 +00:00
Simplify caching
This commit is contained in:
parent
92c2dafa12
commit
7c9c9f1ce1
@ -13,6 +13,7 @@ using osu.Framework.Allocation;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
[Cached(typeof(IPreviewTrackOwner))]
|
||||
public class TestSceneMatchBeatmapPanel : MultiplayerTestScene, IPreviewTrackOwner
|
||||
{
|
||||
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||
@ -48,12 +49,5 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
previewTrackManager.StopAnyPlaying(this);
|
||||
});
|
||||
}
|
||||
|
||||
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
|
||||
{
|
||||
var dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
|
||||
dependencies.CacheAs<IPreviewTrackOwner>(this);
|
||||
return dependencies;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ using PlaylistItem = osu.Game.Online.Multiplayer.PlaylistItem;
|
||||
|
||||
namespace osu.Game.Screens.Multi.Match
|
||||
{
|
||||
[Cached(typeof(IPreviewTrackOwner))]
|
||||
public class MatchSubScreen : MultiplayerSubScreen, IPreviewTrackOwner
|
||||
{
|
||||
public override bool DisallowExternalBeatmapRulesetChanges => true;
|
||||
@ -237,13 +238,6 @@ namespace osu.Game.Screens.Multi.Match
|
||||
}
|
||||
}
|
||||
|
||||
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
|
||||
{
|
||||
var dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
|
||||
dependencies.CacheAs<IPreviewTrackOwner>(this);
|
||||
return dependencies;
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
base.Dispose(isDisposing);
|
||||
|
Loading…
Reference in New Issue
Block a user