1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 04:02:57 +08:00

Remove AddClock method to CreateManagedClock

This commit is contained in:
Dean Herbert 2022-08-23 13:52:43 +09:00
parent 1191b6c080
commit 553897f2f0
4 changed files with 10 additions and 10 deletions

View File

@ -29,8 +29,8 @@ namespace osu.Game.Tests.OnlinePlay
public void Setup()
{
syncManager = new CatchUpSyncManager(master = new GameplayClockContainer(new TestManualClock()));
player1 = syncManager.AddClock();
player2 = syncManager.AddClock();
player1 = syncManager.CreateManagedClock();
player2 = syncManager.CreateManagedClock();
clocksById = new Dictionary<ISpectatorPlayerClock, int>
{

View File

@ -54,14 +54,14 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
MasterClock = master;
}
public ISpectatorPlayerClock AddClock()
public ISpectatorPlayerClock CreateManagedClock()
{
var clock = new CatchUpSpectatorPlayerClock(MasterClock);
playerClocks.Add(clock);
return clock;
}
public void RemoveClock(ISpectatorPlayerClock clock)
public void RemoveManagedClock(ISpectatorPlayerClock clock)
{
playerClocks.Remove(clock);
clock.Stop();

View File

@ -28,15 +28,15 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
IBindable<MasterClockState> MasterState { get; }
/// <summary>
/// Adds a new managed <see cref="ISpectatorPlayerClock"/>.
/// Create a new managed <see cref="ISpectatorPlayerClock"/>.
/// </summary>
/// <returns>The added <see cref="ISpectatorPlayerClock"/>.</returns>
ISpectatorPlayerClock AddClock();
/// <returns>The newly created <see cref="ISpectatorPlayerClock"/>.</returns>
ISpectatorPlayerClock CreateManagedClock();
/// <summary>
/// Removes an <see cref="ISpectatorPlayerClock"/>, stopping it from being managed by this <see cref="ISyncManager"/>.
/// </summary>
/// <param name="clock">The <see cref="ISpectatorPlayerClock"/> to remove.</param>
void RemoveClock(ISpectatorPlayerClock clock);
void RemoveManagedClock(ISpectatorPlayerClock clock);
}
}

View File

@ -123,7 +123,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
};
for (int i = 0; i < Users.Count; i++)
grid.Add(instances[i] = new PlayerArea(Users[i], syncManager.AddClock()));
grid.Add(instances[i] = new PlayerArea(Users[i], syncManager.CreateManagedClock()));
LoadComponentAsync(leaderboard = new MultiSpectatorLeaderboard(users)
{
@ -237,7 +237,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
var instance = instances.Single(i => i.UserId == userId);
instance.FadeColour(colours.Gray4, 400, Easing.OutQuint);
syncManager.RemoveClock(instance.GameplayClock);
syncManager.RemoveManagedClock(instance.GameplayClock);
}
public override bool OnBackButton()