Remove startFromSkipTarget parameter and update usages that required said behaviour

This commit is contained in:
Dean Herbert
2022-04-13 14:09:49 +09:00
parent a59c6013c7
commit fbf0e5a45c
4 changed files with 11 additions and 13 deletions

View File

@ -88,7 +88,7 @@ namespace osu.Game.Tests.Gameplay
[Test] [Test]
public void TestSampleHasLifetimeEndWithInitialClockTime() public void TestSampleHasLifetimeEndWithInitialClockTime()
{ {
GameplayClockContainer gameplayContainer = null; MasterGameplayClockContainer gameplayContainer = null;
DrawableStoryboardSample sample = null; DrawableStoryboardSample sample = null;
AddStep("create container", () => AddStep("create container", () =>
@ -96,8 +96,11 @@ namespace osu.Game.Tests.Gameplay
var working = CreateWorkingBeatmap(new OsuRuleset().RulesetInfo); var working = CreateWorkingBeatmap(new OsuRuleset().RulesetInfo);
working.LoadTrack(); working.LoadTrack();
Add(gameplayContainer = new MasterGameplayClockContainer(working, 1000, true) const double start_time = 1000;
Add(gameplayContainer = new MasterGameplayClockContainer(working, start_time)
{ {
StartTime = start_time,
IsPaused = { Value = true }, IsPaused = { Value = true },
Child = new FrameStabilityContainer Child = new FrameStabilityContainer
{ {

View File

@ -464,16 +464,16 @@ namespace osu.Game.Tests.Visual.Multiplayer
private class TestMultiSpectatorScreen : MultiSpectatorScreen private class TestMultiSpectatorScreen : MultiSpectatorScreen
{ {
private readonly double? gameplayStartTime; private readonly double? startTime;
public TestMultiSpectatorScreen(Room room, MultiplayerRoomUser[] users, double? gameplayStartTime = null) public TestMultiSpectatorScreen(Room room, MultiplayerRoomUser[] users, double? startTime = null)
: base(room, users) : base(room, users)
{ {
this.gameplayStartTime = gameplayStartTime; this.startTime = startTime;
} }
protected override MasterGameplayClockContainer CreateMasterGameplayClockContainer(WorkingBeatmap beatmap) protected override MasterGameplayClockContainer CreateMasterGameplayClockContainer(WorkingBeatmap beatmap)
=> new MasterGameplayClockContainer(beatmap, gameplayStartTime ?? 0, true); => new MasterGameplayClockContainer(beatmap, 0) { StartTime = startTime ?? 0 };
} }
} }
} }

View File

@ -25,7 +25,7 @@ namespace osu.Game.Screens.Edit.GameplayTest
} }
protected override GameplayClockContainer CreateGameplayClockContainer(WorkingBeatmap beatmap, double gameplayStart) protected override GameplayClockContainer CreateGameplayClockContainer(WorkingBeatmap beatmap, double gameplayStart)
=> new MasterGameplayClockContainer(beatmap, editorState.Time, true); => new MasterGameplayClockContainer(beatmap, gameplayStart) { StartTime = editorState.Time };
protected override void LoadComplete() protected override void LoadComplete()
{ {

View File

@ -71,16 +71,11 @@ namespace osu.Game.Screens.Play
/// </summary> /// </summary>
/// <param name="beatmap">The beatmap to be used for time and metadata references.</param> /// <param name="beatmap">The beatmap to be used for time and metadata references.</param>
/// <param name="skipTargetTime">The latest time which should be used when introducing gameplay. Will be used when skipping forward.</param> /// <param name="skipTargetTime">The latest time which should be used when introducing gameplay. Will be used when skipping forward.</param>
/// <param name="startFromSkipTarget">Whether to start from the provided latest start time rather than zero.</param> public MasterGameplayClockContainer(WorkingBeatmap beatmap, double skipTargetTime)
public MasterGameplayClockContainer(WorkingBeatmap beatmap, double skipTargetTime, bool startFromSkipTarget = false)
: base(beatmap.Track) : base(beatmap.Track)
{ {
this.beatmap = beatmap; this.beatmap = beatmap;
this.skipTargetTime = skipTargetTime; this.skipTargetTime = skipTargetTime;
if (startFromSkipTarget)
StartTime = skipTargetTime;
} }
protected override void LoadComplete() protected override void LoadComplete()