1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 06:57:51 +08:00

Refactor hit object application scene to work reliably

This commit is contained in:
Bartłomiej Dach 2020-12-14 22:51:35 +01:00
parent a31e8d137f
commit 232c0205b4
2 changed files with 14 additions and 7 deletions

View File

@ -25,16 +25,22 @@ namespace osu.Game.Rulesets.Taiko.Tests
private ScrollingHitObjectContainer hitObjectContainer;
[SetUpSteps]
public void SetUp()
=> AddStep("create SHOC", () => Child = hitObjectContainer = new ScrollingHitObjectContainer
[BackgroundDependencyLoader]
private void load()
{
Child = hitObjectContainer = new ScrollingHitObjectContainer
{
RelativeSizeAxes = Axes.X,
Height = 200,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Clock = new FramedClock(new StopwatchClock())
});
};
}
[SetUpSteps]
public void SetUp()
=> AddStep("clear SHOC", () => hitObjectContainer.Clear(false));
protected void AddHitObject(DrawableHitObject hitObject)
=> AddStep("add to SHOC", () => hitObjectContainer.Add(hitObject));

View File

@ -12,12 +12,13 @@ namespace osu.Game.Rulesets.Taiko.Tests
[Test]
public void TestApplyNewBarLine()
{
DrawableBarLine barLine = new DrawableBarLine(PrepareObject(new BarLine
DrawableBarLine barLine = new DrawableBarLine();
AddStep("apply new bar line", () => barLine.Apply(PrepareObject(new BarLine
{
StartTime = 400,
Major = true
}));
}), null));
AddHitObject(barLine);
RemoveHitObject(barLine);