Add "ranked" attribute to scores

This commit is contained in:
Salman Ahmed 2024-02-05 23:27:16 +03:00
parent 938bbe38b7
commit 4be4ed7ab2
2 changed files with 10 additions and 0 deletions

View File

@ -115,6 +115,9 @@ public APIBeatmapSet? BeatmapSet
[JsonProperty("has_replay")]
public bool HasReplay { get; set; }
[JsonProperty("ranked")]
public bool Ranked { get; set; }
// These properties are calculated or not relevant to any external usage.
public bool ShouldSerializeID() => false;
public bool ShouldSerializeUser() => false;
@ -212,6 +215,7 @@ public ScoreInfo ToScoreInfo(Mod[] mods, IBeatmapInfo? beatmap = null)
HasOnlineReplay = HasReplay,
Mods = mods,
PP = PP,
Ranked = Ranked,
};
if (beatmap is BeatmapInfo realmBeatmap)

View File

@ -107,6 +107,12 @@ public class ScoreInfo : RealmObject, IHasGuidPrimaryKey, IHasRealmFiles, ISoftD
public double? PP { get; set; }
/// <summary>
/// Whether the performance points in this score is awarded to the player. This is used for online display purposes (see <see cref="SoloScoreInfo.Ranked"/>).
/// </summary>
[Ignored]
public bool Ranked { get; set; }
/// <summary>
/// The online ID of this score.
/// </summary>