2021-10-01 13:34:11 +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-11-15 13:34:50 +08:00
using System ;
2021-10-01 15:31:11 +08:00
namespace osu.Game.Database
2021-10-01 13:34:11 +08:00
{
2021-10-29 10:48:36 +08:00
public interface IHasOnlineID < out T >
2021-11-15 13:34:50 +08:00
where T : IEquatable < T >
2021-10-01 13:34:11 +08:00
{
/// <summary>
2021-10-29 15:53:54 +08:00
/// The server-side ID representing this instance, if one exists. Any value 0 or less denotes a missing ID (except in special cases where autoincrement is not used, like rulesets).
2021-10-01 13:34:11 +08:00
/// </summary>
2021-10-20 14:24:27 +08:00
/// <remarks>
/// Generally we use -1 when specifying "missing" in code, but values of 0 are also considered missing as the online source
/// is generally a MySQL autoincrement value, which can never be 0.
/// </remarks>
2021-10-29 10:48:36 +08:00
T OnlineID { get ; }
2021-10-01 13:34:11 +08:00
}
}