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:
parent
a31e8d137f
commit
232c0205b4
@ -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));
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user