mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 14:42:56 +08:00
Improve TestCaseTaikoPlayfield.
This commit is contained in:
parent
fcea52dd3a
commit
eed78d4251
@ -20,7 +20,11 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
|
|
||||||
private TaikoPlayfield playfield;
|
private TaikoPlayfield playfield;
|
||||||
|
|
||||||
protected override double TimePerAction => 500;
|
protected override double TimePerAction => default_duration * 2;
|
||||||
|
|
||||||
|
private const double default_duration = 300;
|
||||||
|
|
||||||
|
private const float scroll_time = 1000;
|
||||||
|
|
||||||
public override void Reset()
|
public override void Reset()
|
||||||
{
|
{
|
||||||
@ -30,7 +34,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
AddStep("Miss :(", addMissJudgement);
|
AddStep("Miss :(", addMissJudgement);
|
||||||
AddStep("DrumRoll", () => addDrumRoll(false));
|
AddStep("DrumRoll", () => addDrumRoll(false));
|
||||||
AddStep("Strong DrumRoll", () => addDrumRoll(true));
|
AddStep("Strong DrumRoll", () => addDrumRoll(true));
|
||||||
AddStep("Swell", addSwell);
|
AddStep("Swell", () => addSwell());
|
||||||
AddStep("Centre", () => addCentreHit(false));
|
AddStep("Centre", () => addCentreHit(false));
|
||||||
AddStep("Strong Centre", () => addCentreHit(true));
|
AddStep("Strong Centre", () => addCentreHit(true));
|
||||||
AddStep("Rim", () => addRimHit(false));
|
AddStep("Rim", () => addRimHit(false));
|
||||||
@ -82,35 +86,38 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addBarLine(bool major)
|
private void addBarLine(bool major, double delay = scroll_time)
|
||||||
{
|
{
|
||||||
BarLine bl = new BarLine
|
BarLine bl = new BarLine
|
||||||
{
|
{
|
||||||
StartTime = Time.Current + 1000,
|
StartTime = playfield.Time.Current + delay,
|
||||||
ScrollTime = 1000
|
ScrollTime = scroll_time
|
||||||
};
|
};
|
||||||
|
|
||||||
playfield.AddBarLine(major ? new DrawableBarLineMajor(bl) : new DrawableBarLine(bl));
|
playfield.AddBarLine(major ? new DrawableBarLineMajor(bl) : new DrawableBarLine(bl));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addSwell()
|
private void addSwell(double duration = default_duration)
|
||||||
{
|
{
|
||||||
playfield.Add(new DrawableSwell(new Swell
|
playfield.Add(new DrawableSwell(new Swell
|
||||||
{
|
{
|
||||||
StartTime = Time.Current + 1000,
|
StartTime = playfield.Time.Current + scroll_time,
|
||||||
EndTime = Time.Current + 1000,
|
Duration = duration,
|
||||||
ScrollTime = 1000
|
ScrollTime = scroll_time
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addDrumRoll(bool strong)
|
private void addDrumRoll(bool strong, double duration = default_duration)
|
||||||
{
|
{
|
||||||
|
addBarLine(true);
|
||||||
|
addBarLine(true, scroll_time + duration);
|
||||||
|
|
||||||
var d = new DrumRoll
|
var d = new DrumRoll
|
||||||
{
|
{
|
||||||
StartTime = Time.Current + 1000,
|
StartTime = playfield.Time.Current + scroll_time,
|
||||||
IsStrong = strong,
|
IsStrong = strong,
|
||||||
Distance = 1000,
|
Duration = duration,
|
||||||
ScrollTime = 1000,
|
ScrollTime = scroll_time,
|
||||||
};
|
};
|
||||||
|
|
||||||
playfield.Add(new DrawableDrumRoll(d));
|
playfield.Add(new DrawableDrumRoll(d));
|
||||||
@ -120,8 +127,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
Hit h = new Hit
|
Hit h = new Hit
|
||||||
{
|
{
|
||||||
StartTime = Time.Current + 1000,
|
StartTime = playfield.Time.Current + scroll_time,
|
||||||
ScrollTime = 1000
|
ScrollTime = scroll_time
|
||||||
};
|
};
|
||||||
|
|
||||||
if (strong)
|
if (strong)
|
||||||
@ -134,8 +141,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
Hit h = new Hit
|
Hit h = new Hit
|
||||||
{
|
{
|
||||||
StartTime = Time.Current + 1000,
|
StartTime = playfield.Time.Current + scroll_time,
|
||||||
ScrollTime = 1000
|
ScrollTime = scroll_time
|
||||||
};
|
};
|
||||||
|
|
||||||
if (strong)
|
if (strong)
|
||||||
|
Loading…
Reference in New Issue
Block a user