mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 21:52:55 +08:00
Use DependencyProvidingContainer
in TestSceneCatcher
This commit is contained in:
parent
d3bb4ddbee
commit
5a0a223b1b
@ -31,22 +31,9 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
[Resolved]
|
||||
private OsuConfigManager config { get; set; }
|
||||
|
||||
[Cached]
|
||||
private readonly DroppedObjectContainer droppedObjectContainer;
|
||||
|
||||
private readonly Container trailContainer;
|
||||
|
||||
private TestCatcher catcher;
|
||||
|
||||
public TestSceneCatcher()
|
||||
{
|
||||
Add(trailContainer = new Container
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Depth = -1
|
||||
});
|
||||
Add(droppedObjectContainer = new DroppedObjectContainer());
|
||||
}
|
||||
private DroppedObjectContainer droppedObjectContainer;
|
||||
|
||||
[SetUp]
|
||||
public void SetUp() => Schedule(() =>
|
||||
@ -56,13 +43,24 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
CircleSize = 0,
|
||||
};
|
||||
|
||||
if (catcher != null)
|
||||
Remove(catcher);
|
||||
|
||||
Add(catcher = new TestCatcher(trailContainer, difficulty)
|
||||
var trailContainer = new Container
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
};
|
||||
Child = new DependencyProvidingContainer
|
||||
{
|
||||
Types = new[]
|
||||
{
|
||||
typeof(DroppedObjectContainer),
|
||||
},
|
||||
Children = new Drawable[]
|
||||
{
|
||||
droppedObjectContainer = new DroppedObjectContainer(),
|
||||
catcher = new TestCatcher(trailContainer, difficulty),
|
||||
trailContainer
|
||||
},
|
||||
Anchor = Anchor.Centre
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
[Test]
|
||||
|
Loading…
Reference in New Issue
Block a user