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;
|
2021-04-15 18:32:55 +08:00
|
|
|
using osu.Framework.Timing;
|
|
|
|
|
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>
|
|
|
|
event Action ReadyToStart;
|
|
|
|
|
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>
|
2021-04-26 16:19:44 +08:00
|
|
|
IAdjustableClock 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>
|
2021-04-26 16:19:44 +08:00
|
|
|
/// Adds an <see cref="ISpectatorPlayerClock"/> to manage.
|
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 add.</param>
|
|
|
|
void AddPlayerClock(ISpectatorPlayerClock clock);
|
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>
|
|
|
|
void RemovePlayerClock(ISpectatorPlayerClock clock);
|
2021-04-15 18:32:55 +08:00
|
|
|
}
|
|
|
|
}
|