mirror of
https://github.com/osukey/osukey.git
synced 2025-04-29 02:37:25 +09: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
|
namespace osu.Game.Online.Rooms
|
||||||
{
|
{
|
||||||
[JsonObject(MemberSerialization.OptIn)]
|
[JsonObject(MemberSerialization.OptIn)]
|
||||||
public partial class Room
|
public partial class Room : IDependencyInjectionCandidate
|
||||||
{
|
{
|
||||||
[Cached]
|
[Cached]
|
||||||
[JsonProperty("id")]
|
[JsonProperty("id")]
|
||||||
|
@ -233,7 +233,7 @@ namespace osu.Game.Overlays.FirstRunSetup
|
|||||||
return parentDependencies.Get(type, info);
|
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);
|
parentDependencies.Inject(instance);
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,7 @@ namespace osu.Game.Tests.Beatmaps
|
|||||||
return fallback.Get(type, info);
|
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
|
// Never used directly
|
||||||
}
|
}
|
||||||
|
@ -128,7 +128,7 @@ namespace osu.Game.Tests.Visual.OnlinePlay
|
|||||||
=> OnlinePlayDependencies?.Get(type, info) ?? parent.Get(type, info);
|
=> OnlinePlayDependencies?.Get(type, info) ?? parent.Get(type, info);
|
||||||
|
|
||||||
public void Inject<T>(T instance)
|
public void Inject<T>(T instance)
|
||||||
where T : class
|
where T : class, IDependencyInjectionCandidate
|
||||||
=> injectableDependencies.Inject(instance);
|
=> injectableDependencies.Inject(instance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ namespace osu.Game.Tests.Visual.OnlinePlay
|
|||||||
=> dependencies.Get(type, info);
|
=> dependencies.Get(type, info);
|
||||||
|
|
||||||
public void Inject<T>(T instance)
|
public void Inject<T>(T instance)
|
||||||
where T : class
|
where T : class, IDependencyInjectionCandidate
|
||||||
=> dependencies.Inject(instance);
|
=> dependencies.Inject(instance);
|
||||||
|
|
||||||
protected void Cache(object instance)
|
protected void Cache(object instance)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user