mirror of
https://github.com/ppy/osu.git
synced 2025-01-21 12:12:56 +08:00
Add a function for loading a list of breaks
This commit is contained in:
parent
95b568eb46
commit
4d49b38277
@ -63,9 +63,8 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
var shortBreak = new BreakPeriod { EndTime = 500 };
|
var shortBreak = new BreakPeriod { EndTime = 500 };
|
||||||
|
|
||||||
loadClockStep(true);
|
loadClockStep(true);
|
||||||
AddStep("start short break", () => manualBreakOverlay.Breaks = new[] { shortBreak });
|
loadBreaksStep("short break", new[] { shortBreak });
|
||||||
|
|
||||||
seekBreakStep("seek back to 0", 0, false);
|
|
||||||
addBreakSeeks(shortBreak, false);
|
addBreakSeeks(shortBreak, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,9 +72,8 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
public void TestMultipleBreaks()
|
public void TestMultipleBreaks()
|
||||||
{
|
{
|
||||||
loadClockStep(true);
|
loadClockStep(true);
|
||||||
AddStep("start multiple breaks", () => manualBreakOverlay.Breaks = testBreaks);
|
loadBreaksStep("multiple breaks", testBreaks);
|
||||||
|
|
||||||
seekBreakStep("seek back to 0", 0, false);
|
|
||||||
foreach (var b in testBreaks)
|
foreach (var b in testBreaks)
|
||||||
addBreakSeeks(b, false);
|
addBreakSeeks(b, false);
|
||||||
}
|
}
|
||||||
@ -84,9 +82,8 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
public void TestRewindBreaks()
|
public void TestRewindBreaks()
|
||||||
{
|
{
|
||||||
loadClockStep(true);
|
loadClockStep(true);
|
||||||
AddStep("start multiple breaks in rewind", () => manualBreakOverlay.Breaks = testBreaks);
|
loadBreaksStep("multiple breaks", testBreaks);
|
||||||
|
|
||||||
seekBreakStep("seek back to 0", 0, false);
|
|
||||||
foreach (var b in testBreaks.Reverse())
|
foreach (var b in testBreaks.Reverse())
|
||||||
addBreakSeeks(b, true);
|
addBreakSeeks(b, true);
|
||||||
}
|
}
|
||||||
@ -95,10 +92,9 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
public void TestSkipBreaks()
|
public void TestSkipBreaks()
|
||||||
{
|
{
|
||||||
loadClockStep(true);
|
loadClockStep(true);
|
||||||
AddStep("start multiple breaks with skipping", () => manualBreakOverlay.Breaks = testBreaks);
|
loadBreaksStep("multiple breaks", testBreaks);
|
||||||
|
|
||||||
var b = testBreaks.Last();
|
var b = testBreaks.Last();
|
||||||
seekBreakStep("seek back to 0", 0, false);
|
|
||||||
addBreakSeeks(b, false);
|
addBreakSeeks(b, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,6 +119,12 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void loadBreaksStep(string breakDescription, IReadOnlyList<BreakPeriod> breaks)
|
||||||
|
{
|
||||||
|
AddStep($"load {breakDescription}", () => manualBreakOverlay.Breaks = breaks);
|
||||||
|
seekBreakStep("seek back to 0", 0, false);
|
||||||
|
}
|
||||||
|
|
||||||
private void addBreakSeeks(BreakPeriod b, bool isReversed)
|
private void addBreakSeeks(BreakPeriod b, bool isReversed)
|
||||||
{
|
{
|
||||||
if (isReversed)
|
if (isReversed)
|
||||||
|
Loading…
Reference in New Issue
Block a user