Rename FinishCountdown() -> SkipToEndOfCountdown()

This commit is contained in:
Dan Balasescu
2022-03-24 15:21:46 +09:00
parent d2ecc100e5
commit f0d132b16e
2 changed files with 11 additions and 7 deletions

View File

@ -296,11 +296,15 @@ namespace osu.Game.Tests.Visual.Multiplayer
return Task.CompletedTask;
}
private CancellationTokenSource? countdownFinishSource;
private CancellationTokenSource? countdownSkipSource;
private CancellationTokenSource? countdownStopSource;
private Task countdownTask = Task.CompletedTask;
public void FinishCountdown() => countdownFinishSource?.Cancel();
/// <summary>
/// Skips to the end of the currently-running countdown, if one is running,
/// and runs the callback (e.g. to start the match) as soon as possible unless the countdown has been cancelled.
/// </summary>
public void SkipToEndOfCountdown() => countdownSkipSource?.Cancel();
public override async Task SendMatchRequest(MatchUserRequest request)
{
@ -313,8 +317,8 @@ namespace osu.Game.Tests.Visual.Multiplayer
countdownStopSource?.Cancel();
var stopSource = countdownStopSource = new CancellationTokenSource();
var finishSource = countdownFinishSource = new CancellationTokenSource();
var cancellationSource = CancellationTokenSource.CreateLinkedTokenSource(stopSource.Token, finishSource.Token);
var skipSource = countdownSkipSource = new CancellationTokenSource();
var cancellationSource = CancellationTokenSource.CreateLinkedTokenSource(stopSource.Token, skipSource.Token);
var countdown = new MatchStartCountdown { TimeRemaining = matchCountdownRequest.Duration };
Task lastCountdownTask = countdownTask;