osu/osu.Game/Tests/Visual/RoomTestScene.cs

34 lines
1.0 KiB
C#
Raw Normal View History

2019-02-05 10:00:01 +00:00
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
2020-12-18 05:58:58 +00:00
using NUnit.Framework;
2019-02-05 10:00:01 +00:00
using osu.Framework.Allocation;
2019-02-21 10:04:31 +00:00
using osu.Framework.Bindables;
2020-12-25 04:38:11 +00:00
using osu.Game.Online.Rooms;
2019-02-05 10:00:01 +00:00
namespace osu.Game.Tests.Visual
{
2020-12-25 04:38:11 +00:00
public abstract class RoomTestScene : ScreenTestScene
2019-02-05 10:00:01 +00:00
{
2019-02-08 07:02:14 +00:00
[Cached]
private readonly Bindable<Room> currentRoom = new Bindable<Room>();
2019-02-05 10:00:01 +00:00
2020-12-18 05:58:58 +00:00
protected Room Room => currentRoom.Value;
2019-02-05 10:00:01 +00:00
private CachedModelDependencyContainer<Room> dependencies;
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
{
dependencies = new CachedModelDependencyContainer<Room>(base.CreateChildDependencies(parent));
2019-02-08 07:02:14 +00:00
dependencies.Model.BindTo(currentRoom);
2019-02-05 10:00:01 +00:00
return dependencies;
}
2020-12-18 05:58:58 +00:00
[SetUp]
public void Setup() => Schedule(() =>
{
currentRoom.Value = new Room();
2020-12-18 05:58:58 +00:00
});
2019-02-05 10:00:01 +00:00
}
}