Use similar method of consuming OnlineID as done in beatmap classes

This commit is contained in:
Dean Herbert
2021-12-10 18:32:32 +09:00
parent c9f6c5c673
commit f7c5a3f506
3 changed files with 11 additions and 9 deletions

View File

@ -137,7 +137,14 @@ namespace osu.Game.Scoring
[Column("Beatmap")]
public BeatmapInfo BeatmapInfo { get; set; }
public long? OnlineScoreID { get; set; }
private long? onlineID;
[Column("OnlineScoreID")]
public long? OnlineID
{
get => onlineID;
set => onlineID = value > 0 ? value : null;
}
public DateTimeOffset Date { get; set; }
@ -243,12 +250,7 @@ namespace osu.Game.Scoring
#region Implementation of IHasOnlineID
[NotMapped]
public long OnlineID
{
get => OnlineScoreID ?? -1;
set => OnlineScoreID = value;
}
long IHasOnlineID<long>.OnlineID => OnlineID ?? -1;
#endregion