Rewrite FramedReplayInputHandler for robustness

This commit changes the semantics of `CurrentFrame` and `NextFrame` of the class.
The ordering of `NextFrame.Time` and `CurrentFrame.Time` was dependent on the current direction.
Now, it should always satisfy `CurrentFrame.Time <= CurrentTime <= NextFrame.Time` except at the start/end.
This change, however, doesn't break existing deriving classes if the template code pattern usage of interpolation is used.
The deriving class code can be simplified due to the elimination of nullable types. I didn't include those changes in this commit.

I removed `StreamingFramedReplayInputHandlerTest` for now, as it is almost-duplicate of `FramedReplayInputHandlerTest`. I'll include more tests in later commits.

This commit fixes #6150.
This commit is contained in:
ekrctb
2021-04-12 15:52:43 +09:00
parent d6d8ea5b6b
commit e19e8ff2a3
4 changed files with 109 additions and 439 deletions

View File

@ -83,7 +83,7 @@ namespace osu.Game.Tests.Visual.Gameplay
waitForPlayer();
AddAssert("ensure frames arrived", () => replayHandler.HasFrames);
AddUntilStep("wait for frame starvation", () => replayHandler.NextFrame == null);
AddUntilStep("wait for frame starvation", () => replayHandler.WaitingNextFrame);
checkPaused(true);
double? pausedTime = null;
@ -92,7 +92,7 @@ namespace osu.Game.Tests.Visual.Gameplay
sendFrames();
AddUntilStep("wait for frame starvation", () => replayHandler.NextFrame == null);
AddUntilStep("wait for frame starvation", () => replayHandler.WaitingNextFrame);
checkPaused(true);
AddAssert("time advanced", () => currentFrameStableTime > pausedTime);