mirror of
https://github.com/ppy/osu
synced 2025-01-25 07:13:22 +00:00
Seek using GameplayClockContainer
This commit is contained in:
parent
3d2fcb0cca
commit
a511e64fa5
@ -155,16 +155,16 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
// This is because the (parent) object will only play its sample at the final EndTime.
|
// This is because the (parent) object will only play its sample at the final EndTime.
|
||||||
AddAssert("check valid object is slider's first nested", () => sampleTriggerSource.GetMostValidObject(), () => Is.EqualTo(beatmap.HitObjects[4].NestedHitObjects.First()));
|
AddAssert("check valid object is slider's first nested", () => sampleTriggerSource.GetMostValidObject(), () => Is.EqualTo(beatmap.HitObjects[4].NestedHitObjects.First()));
|
||||||
|
|
||||||
AddStep("seek to just before slider ends", () => Beatmap.Value.Track.Seek(beatmap.HitObjects[4].GetEndTime() - 100));
|
AddStep("seek to just before slider ends", () => Player.GameplayClockContainer.Seek(beatmap.HitObjects[4].GetEndTime() - 100));
|
||||||
waitForCatchUp();
|
waitForCatchUp();
|
||||||
AddUntilStep("wait until valid object is slider's last nested", () => sampleTriggerSource.GetMostValidObject(), () => Is.EqualTo(beatmap.HitObjects[4].NestedHitObjects.Last()));
|
AddUntilStep("wait until valid object is slider's last nested", () => sampleTriggerSource.GetMostValidObject(), () => Is.EqualTo(beatmap.HitObjects[4].NestedHitObjects.Last()));
|
||||||
|
|
||||||
// After we get far enough away, the samples of the object itself should be used, not any nested object.
|
// After we get far enough away, the samples of the object itself should be used, not any nested object.
|
||||||
AddStep("seek to further after slider", () => Beatmap.Value.Track.Seek(beatmap.HitObjects[4].GetEndTime() + 1000));
|
AddStep("seek to further after slider", () => Player.GameplayClockContainer.Seek(beatmap.HitObjects[4].GetEndTime() + 1000));
|
||||||
waitForCatchUp();
|
waitForCatchUp();
|
||||||
AddUntilStep("wait until valid object is slider itself", () => sampleTriggerSource.GetMostValidObject(), () => Is.EqualTo(beatmap.HitObjects[4]));
|
AddUntilStep("wait until valid object is slider itself", () => sampleTriggerSource.GetMostValidObject(), () => Is.EqualTo(beatmap.HitObjects[4]));
|
||||||
|
|
||||||
AddStep("Seek into future", () => Beatmap.Value.Track.Seek(beatmap.HitObjects.Last().GetEndTime() + 10000));
|
AddStep("Seek into future", () => Player.GameplayClockContainer.Seek(beatmap.HitObjects.Last().GetEndTime() + 10000));
|
||||||
waitForCatchUp();
|
waitForCatchUp();
|
||||||
waitForAliveObjectIndex(null);
|
waitForAliveObjectIndex(null);
|
||||||
checkValidObjectIndex(4);
|
checkValidObjectIndex(4);
|
||||||
@ -172,7 +172,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
|
|
||||||
private void seekBeforeIndex(int index)
|
private void seekBeforeIndex(int index)
|
||||||
{
|
{
|
||||||
AddStep($"seek to just before object {index}", () => Beatmap.Value.Track.Seek(beatmap.HitObjects[index].StartTime - 100));
|
AddStep($"seek to just before object {index}", () => Player.GameplayClockContainer.Seek(beatmap.HitObjects[index].StartTime - 100));
|
||||||
waitForCatchUp();
|
waitForCatchUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user