mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 10:22:56 +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;
|
private ScrollingHitObjectContainer hitObjectContainer;
|
||||||
|
|
||||||
[SetUpSteps]
|
[BackgroundDependencyLoader]
|
||||||
public void SetUp()
|
private void load()
|
||||||
=> AddStep("create SHOC", () => Child = hitObjectContainer = new ScrollingHitObjectContainer
|
{
|
||||||
|
Child = hitObjectContainer = new ScrollingHitObjectContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Height = 200,
|
Height = 200,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Clock = new FramedClock(new StopwatchClock())
|
Clock = new FramedClock(new StopwatchClock())
|
||||||
});
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
[SetUpSteps]
|
||||||
|
public void SetUp()
|
||||||
|
=> AddStep("clear SHOC", () => hitObjectContainer.Clear(false));
|
||||||
|
|
||||||
protected void AddHitObject(DrawableHitObject hitObject)
|
protected void AddHitObject(DrawableHitObject hitObject)
|
||||||
=> AddStep("add to SHOC", () => hitObjectContainer.Add(hitObject));
|
=> AddStep("add to SHOC", () => hitObjectContainer.Add(hitObject));
|
||||||
|
@ -12,12 +12,13 @@ namespace osu.Game.Rulesets.Taiko.Tests
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestApplyNewBarLine()
|
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,
|
StartTime = 400,
|
||||||
Major = true
|
Major = true
|
||||||
}));
|
}), null));
|
||||||
|
|
||||||
AddHitObject(barLine);
|
AddHitObject(barLine);
|
||||||
RemoveHitObject(barLine);
|
RemoveHitObject(barLine);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user