2021-10-01 14:34:11 +09: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 14:34:50 +09:00
using System ;
2021-10-01 16:31:11 +09:00
namespace osu.Game.Database
2021-10-01 14:34:11 +09:00
{
2021-10-29 11:48:36 +09:00
public interface IHasOnlineID < out T >
2021-11-15 14:34:50 +09:00
where T : IEquatable < T >
2021-10-01 14:34:11 +09:00
{
/// <summary>
2021-10-29 16:53:54 +09: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 14:34:11 +09:00
/// </summary>
2021-10-20 15:24:27 +09: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 11:48:36 +09:00
T OnlineID { get ; }
2021-10-01 14:34:11 +09:00
}
}