1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 06:03:08 +08:00
This commit is contained in:
smoogipoo 2021-06-24 16:54:09 +09:00
parent 4af119a407
commit 9287fae5f7

View File

@ -19,19 +19,18 @@ namespace osu.Game.Tests.Visual.OnlinePlay
/// </summary> /// </summary>
public readonly Room Room = new Room(); public readonly Room Room = new Room();
[Cached]
private readonly Bindable<Room> roomBindable;
public TestRoomContainer() public TestRoomContainer()
{ {
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
roomBindable = new Bindable<Room>(Room);
} }
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
{ {
var dependencies = new CachedModelDependencyContainer<Room>(base.CreateChildDependencies(parent)); var dependencies = new DependencyContainer(
dependencies.Model.Value = Room; new CachedModelDependencyContainer<Room>(parent) { Model = { Value = Room } });
dependencies.Cache(new Bindable<Room>(Room));
return dependencies; return dependencies;
} }
} }