1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:12:54 +08:00

Merge pull request #19575 from smoogipoo/solo-score-info-json-cleanup

Clean up SoloScoreInfo serialised output
This commit is contained in:
Dean Herbert 2022-08-04 23:19:21 +09:00 committed by GitHub
commit 0d73bfa451
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,6 +102,14 @@ namespace osu.Game.Online.API.Requests.Responses
[JsonProperty("pp")]
public double? PP { get; set; }
public bool ShouldSerializeID() => false;
public bool ShouldSerializeUser() => false;
public bool ShouldSerializeBeatmap() => false;
public bool ShouldSerializeBeatmapSet() => false;
public bool ShouldSerializePP() => false;
public bool ShouldSerializeOnlineID() => false;
public bool ShouldSerializeHasReplay() => false;
#endregion
public override string ToString() => $"score_id: {ID} user_id: {UserID}";
@ -165,7 +173,7 @@ namespace osu.Game.Online.API.Requests.Responses
RulesetID = score.RulesetID,
Passed = score.Passed,
Mods = score.APIMods,
Statistics = score.Statistics,
Statistics = score.Statistics.Where(kvp => kvp.Value != 0).ToDictionary(kvp => kvp.Key, kvp => kvp.Value),
};
public long OnlineID => ID ?? -1;