2021-04-15 18:32:55 +08:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
2021-06-11 15:25:45 +08:00
|
|
|
using System;
|
2021-06-11 18:15:53 +08:00
|
|
|
using osu.Framework.Bindables;
|
2022-08-22 18:14:06 +08:00
|
|
|
using osu.Game.Screens.Play;
|
2021-04-15 18:32:55 +08:00
|
|
|
|
2021-05-03 12:38:53 +08:00
|
|
|
namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
|
2021-04-15 18:32:55 +08:00
|
|
|
{
|
|
|
|
/// <summary>
|
2021-04-26 16:19:44 +08:00
|
|
|
/// Manages the synchronisation between one or more <see cref="ISpectatorPlayerClock"/>s in relation to a master clock.
|
2021-04-15 18:32:55 +08:00
|
|
|
/// </summary>
|
2021-04-16 21:47:52 +08:00
|
|
|
public interface ISyncManager
|
2021-04-15 18:32:55 +08:00
|
|
|
{
|
2021-06-11 18:15:53 +08:00
|
|
|
/// <summary>
|
|
|
|
/// An event which is invoked when gameplay is ready to start.
|
|
|
|
/// </summary>
|
2022-08-22 20:52:43 +08:00
|
|
|
event Action? ReadyToStart;
|
2021-06-11 18:15:53 +08:00
|
|
|
|
2021-04-15 18:32:55 +08:00
|
|
|
/// <summary>
|
2021-04-26 16:19:44 +08:00
|
|
|
/// The master clock which player clocks should synchronise to.
|
2021-04-15 18:32:55 +08:00
|
|
|
/// </summary>
|
2022-08-22 18:14:06 +08:00
|
|
|
GameplayClockContainer MasterClock { get; }
|
2021-04-15 18:32:55 +08:00
|
|
|
|
2021-06-11 15:25:45 +08:00
|
|
|
/// <summary>
|
2021-06-11 18:15:53 +08:00
|
|
|
/// An event which is invoked when the state of <see cref="MasterClock"/> is changed.
|
2021-06-11 15:25:45 +08:00
|
|
|
/// </summary>
|
2021-06-11 18:15:53 +08:00
|
|
|
IBindable<MasterClockState> MasterState { get; }
|
2021-06-11 15:25:45 +08:00
|
|
|
|
2021-04-15 18:32:55 +08:00
|
|
|
/// <summary>
|
2022-08-23 12:52:43 +08:00
|
|
|
/// Create a new managed <see cref="ISpectatorPlayerClock"/>.
|
2021-04-15 18:32:55 +08:00
|
|
|
/// </summary>
|
2022-08-23 12:52:43 +08:00
|
|
|
/// <returns>The newly created <see cref="ISpectatorPlayerClock"/>.</returns>
|
|
|
|
ISpectatorPlayerClock CreateManagedClock();
|
2021-04-15 18:32:55 +08:00
|
|
|
|
|
|
|
/// <summary>
|
2021-04-26 16:19:44 +08:00
|
|
|
/// Removes an <see cref="ISpectatorPlayerClock"/>, stopping it from being managed by this <see cref="ISyncManager"/>.
|
2021-04-15 18:32:55 +08:00
|
|
|
/// </summary>
|
2021-04-26 16:19:44 +08:00
|
|
|
/// <param name="clock">The <see cref="ISpectatorPlayerClock"/> to remove.</param>
|
2022-08-23 12:52:43 +08:00
|
|
|
void RemoveManagedClock(ISpectatorPlayerClock clock);
|
2021-04-15 18:32:55 +08:00
|
|
|
}
|
|
|
|
}
|