1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-28 01:47:33 +08:00

Allow for long online IDs and implement in ScoreInfo

This commit is contained in:
Dean Herbert 2021-10-29 11:48:36 +09:00
parent 7ab68525b4
commit 34d4715220
5 changed files with 8 additions and 6 deletions

View File

@ -11,7 +11,7 @@ namespace osu.Game.Beatmaps
/// <summary> /// <summary>
/// A single beatmap difficulty. /// A single beatmap difficulty.
/// </summary> /// </summary>
public interface IBeatmapInfo : IHasOnlineID public interface IBeatmapInfo : IHasOnlineID<int>
{ {
/// <summary> /// <summary>
/// The user-specified name given to this beatmap. /// The user-specified name given to this beatmap.

View File

@ -12,7 +12,7 @@ namespace osu.Game.Beatmaps
/// <summary> /// <summary>
/// A representation of a collection of beatmap difficulties, generally packaged as an ".osz" archive. /// A representation of a collection of beatmap difficulties, generally packaged as an ".osz" archive.
/// </summary> /// </summary>
public interface IBeatmapSetInfo : IHasOnlineID public interface IBeatmapSetInfo : IHasOnlineID<int>
{ {
/// <summary> /// <summary>
/// The date when this beatmap was imported. /// The date when this beatmap was imported.

View File

@ -5,7 +5,7 @@
namespace osu.Game.Database namespace osu.Game.Database
{ {
public interface IHasOnlineID public interface IHasOnlineID<out T>
{ {
/// <summary> /// <summary>
/// The server-side ID representing this instance, if one exists. Any value 0 or less denotes a missing ID. /// The server-side ID representing this instance, if one exists. Any value 0 or less denotes a missing ID.
@ -14,6 +14,6 @@ namespace osu.Game.Database
/// Generally we use -1 when specifying "missing" in code, but values of 0 are also considered missing as the online source /// 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. /// is generally a MySQL autoincrement value, which can never be 0.
/// </remarks> /// </remarks>
int OnlineID { get; } T OnlineID { get; }
} }
} }

View File

@ -11,7 +11,7 @@ namespace osu.Game.Rulesets
/// <summary> /// <summary>
/// A representation of a ruleset's metadata. /// A representation of a ruleset's metadata.
/// </summary> /// </summary>
public interface IRulesetInfo : IHasOnlineID public interface IRulesetInfo : IHasOnlineID<int>
{ {
/// <summary> /// <summary>
/// The user-exposed name of this ruleset. /// The user-exposed name of this ruleset.

View File

@ -19,7 +19,7 @@ using osu.Game.Utils;
namespace osu.Game.Scoring namespace osu.Game.Scoring
{ {
public class ScoreInfo : IHasFiles<ScoreFileInfo>, IHasPrimaryKey, ISoftDelete, IEquatable<ScoreInfo>, IDeepCloneable<ScoreInfo> public class ScoreInfo : IHasFiles<ScoreFileInfo>, IHasPrimaryKey, ISoftDelete, IEquatable<ScoreInfo>, IDeepCloneable<ScoreInfo>, IHasOnlineID<long>
{ {
public int ID { get; set; } public int ID { get; set; }
@ -271,5 +271,7 @@ namespace osu.Game.Scoring
return ReferenceEquals(this, other); return ReferenceEquals(this, other);
} }
public long OnlineID => OnlineScoreID ?? -1;
} }
} }