mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 23:52:57 +08:00
Merge pull request #15350 from peppy/long-online-id-score-info
Allow for `long` online IDs and implement in `ScoreInfo`
This commit is contained in:
commit
7de16ff799
@ -11,7 +11,7 @@ namespace osu.Game.Beatmaps
|
||||
/// <summary>
|
||||
/// A single beatmap difficulty.
|
||||
/// </summary>
|
||||
public interface IBeatmapInfo : IHasOnlineID
|
||||
public interface IBeatmapInfo : IHasOnlineID<int>
|
||||
{
|
||||
/// <summary>
|
||||
/// The user-specified name given to this beatmap.
|
||||
|
@ -12,7 +12,7 @@ namespace osu.Game.Beatmaps
|
||||
/// <summary>
|
||||
/// A representation of a collection of beatmap difficulties, generally packaged as an ".osz" archive.
|
||||
/// </summary>
|
||||
public interface IBeatmapSetInfo : IHasOnlineID
|
||||
public interface IBeatmapSetInfo : IHasOnlineID<int>
|
||||
{
|
||||
/// <summary>
|
||||
/// The date when this beatmap was imported.
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
namespace osu.Game.Database
|
||||
{
|
||||
public interface IHasOnlineID
|
||||
public interface IHasOnlineID<out T>
|
||||
{
|
||||
/// <summary>
|
||||
/// 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
|
||||
/// is generally a MySQL autoincrement value, which can never be 0.
|
||||
/// </remarks>
|
||||
int OnlineID { get; }
|
||||
T OnlineID { get; }
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ namespace osu.Game.Rulesets
|
||||
/// <summary>
|
||||
/// A representation of a ruleset's metadata.
|
||||
/// </summary>
|
||||
public interface IRulesetInfo : IHasOnlineID
|
||||
public interface IRulesetInfo : IHasOnlineID<int>
|
||||
{
|
||||
/// <summary>
|
||||
/// The user-exposed name of this ruleset.
|
||||
|
@ -19,7 +19,7 @@ using osu.Game.Utils;
|
||||
|
||||
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; }
|
||||
|
||||
@ -271,5 +271,11 @@ namespace osu.Game.Scoring
|
||||
|
||||
return ReferenceEquals(this, other);
|
||||
}
|
||||
|
||||
#region Implementation of IHasOnlineID
|
||||
|
||||
public long OnlineID => OnlineScoreID ?? -1;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user