mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 15:03:13 +08:00
Add new IDependencyInjectionCandidate
interface to non-drawable cached classes
This commit is contained in:
parent
b5b79e09e4
commit
61c702c02e
@ -16,7 +16,7 @@ using osu.Game.Online.Rooms.RoomStatuses;
|
||||
namespace osu.Game.Online.Rooms
|
||||
{
|
||||
[JsonObject(MemberSerialization.OptIn)]
|
||||
public partial class Room
|
||||
public partial class Room : IDependencyInjectionCandidate
|
||||
{
|
||||
[Cached]
|
||||
[JsonProperty("id")]
|
||||
|
@ -233,7 +233,7 @@ namespace osu.Game.Overlays.FirstRunSetup
|
||||
return parentDependencies.Get(type, info);
|
||||
}
|
||||
|
||||
public void Inject<T>(T instance) where T : class
|
||||
public void Inject<T>(T instance) where T : class, IDependencyInjectionCandidate
|
||||
{
|
||||
parentDependencies.Inject(instance);
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ namespace osu.Game.Tests.Beatmaps
|
||||
return fallback.Get(type, info);
|
||||
}
|
||||
|
||||
public void Inject<T>(T instance) where T : class
|
||||
public void Inject<T>(T instance) where T : class, IDependencyInjectionCandidate
|
||||
{
|
||||
// Never used directly
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ namespace osu.Game.Tests.Visual.OnlinePlay
|
||||
=> OnlinePlayDependencies?.Get(type, info) ?? parent.Get(type, info);
|
||||
|
||||
public void Inject<T>(T instance)
|
||||
where T : class
|
||||
where T : class, IDependencyInjectionCandidate
|
||||
=> injectableDependencies.Inject(instance);
|
||||
}
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ namespace osu.Game.Tests.Visual.OnlinePlay
|
||||
=> dependencies.Get(type, info);
|
||||
|
||||
public void Inject<T>(T instance)
|
||||
where T : class
|
||||
where T : class, IDependencyInjectionCandidate
|
||||
=> dependencies.Inject(instance);
|
||||
|
||||
protected void Cache(object instance)
|
||||
|
Loading…
Reference in New Issue
Block a user