2022-03-17 18:14:46 +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.
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using MessagePack;
|
2022-03-23 14:19:43 +08:00
|
|
|
using osu.Game.Online.Multiplayer.Countdown;
|
2022-03-17 18:14:46 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Online.Multiplayer
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Describes the current countdown in a <see cref="MultiplayerRoom"/>.
|
|
|
|
/// </summary>
|
|
|
|
[MessagePackObject]
|
|
|
|
[Union(0, typeof(MatchStartCountdown))] // IMPORTANT: Add rules to SignalRUnionWorkaroundResolver for new derived types.
|
2022-04-28 19:00:38 +08:00
|
|
|
[Union(1, typeof(ForceGameplayStartCountdown))]
|
2022-03-17 18:14:46 +08:00
|
|
|
public abstract class MultiplayerCountdown
|
|
|
|
{
|
2022-09-01 17:53:35 +08:00
|
|
|
/// <summary>
|
|
|
|
/// A unique identifier for this countdown.
|
|
|
|
/// </summary>
|
|
|
|
[Key(0)]
|
|
|
|
public int ID { get; set; }
|
|
|
|
|
2022-03-17 18:14:46 +08:00
|
|
|
/// <summary>
|
2022-03-23 14:19:43 +08:00
|
|
|
/// The amount of time remaining in the countdown.
|
2022-03-17 18:14:46 +08:00
|
|
|
/// </summary>
|
2022-03-23 14:19:43 +08:00
|
|
|
/// <remarks>
|
2022-09-01 17:53:35 +08:00
|
|
|
/// This is only sent once from the server upon initial retrieval of the <see cref="MultiplayerRoom"/> or via a <see cref="CountdownStartedEvent"/>.
|
2022-03-23 14:19:43 +08:00
|
|
|
/// </remarks>
|
2022-09-01 17:53:35 +08:00
|
|
|
[Key(1)]
|
2022-03-23 14:19:43 +08:00
|
|
|
public TimeSpan TimeRemaining { get; set; }
|
2022-09-05 19:13:23 +08:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Whether only a single instance of this <see cref="MultiplayerCountdown"/> type may be active at any one time.
|
|
|
|
/// </summary>
|
2022-09-08 16:54:29 +08:00
|
|
|
public virtual bool IsExclusive => true;
|
2022-03-17 18:14:46 +08:00
|
|
|
}
|
|
|
|
}
|