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:
parent
1191b6c080
commit
553897f2f0
@ -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>
|
||||
{
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user