Skip to content

Commit bed4ad1

Browse files
committed
add additional attributes to score model
1 parent 911ae1f commit bed4ad1

5 files changed

Lines changed: 81 additions & 0 deletions

File tree

osu.NET/Endpoints/Beatmaps.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ public async Task<ApiResult<Score[]>> GetUserBeatmapScoresAsync(int beatmapId, i
149149
/// <list type="bullet">
150150
/// <item>The mods parameter is not implemented yet</item>
151151
/// <item>The type parameter is not implemented yet</item>
152+
/// <item>Includes <see cref="Score.User"/></item>
152153
/// </list>
153154
/// <br/><br/>
154155
/// API docs:<br/>

osu.NET/Endpoints/Multiplayer.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ public partial class OsuApiClient
55
// API docs: https://osu.ppy.sh/docs/index.html#multiplayer
66

77
// TODOENDPOINT: https://osu.ppy.sh/docs/index.html#get-scores (pagination)
8+
// TODO: Add "scores_around" to Score model
89
}

osu.NET/Endpoints/Scores.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ public async Task<ApiResult<Score>> GetScoreAsync(long id, Ruleset ruleset, Canc
5959
/// <description>The score could not be found</description>
6060
/// </item>
6161
/// <br/><br/>
62+
/// API notes:
63+
/// <list type="bullet">
64+
/// <item>Includes <see cref="Score.Beatmap"/></item>
65+
/// <item>Includes <see cref="Score.BeatmapSet"/></item>
66+
/// <item>Includes <see cref="Score.GlobalRank"/></item>
67+
/// <item>Includes <see cref="Score.User"/></item>
68+
/// </list>
6269
/// API docs:<br/>
6370
/// <a href="https://osu.ppy.sh/docs/index.html#get-apiv2scoresrulesetorscorescore"/>
6471
/// </summary>

osu.NET/Endpoints/Users.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ public async Task<ApiResult<KudosuHistoryEntry[]>> GetKudosuHistoryAsync(int use
4646
/// <description>The user could not be found</description>
4747
/// </item>
4848
/// <br/><br/>
49+
/// API notes:
50+
/// <list type="bullet">
51+
/// <item>Includes <see cref="Score.Beatmap"/></item>
52+
/// <item>Includes <see cref="Score.BeatmapSet"/></item>
53+
/// <item>Includes <see cref="Score.Weight"/> (if <paramref name="type"/> is <see cref="UserScoreType.Best"/>)</item>
54+
/// </list>
4955
/// API docs:<br/>
5056
/// <a href="https://osu.ppy.sh/docs/index.html#get-user-scores"/>
5157
/// </summary>
@@ -80,6 +86,11 @@ public async Task<ApiResult<Score[]>> GetUserScoresAsync(int userId, UserScoreTy
8086
/// <description>The user could not be found</description>
8187
/// </item>
8288
/// <br/><br/>
89+
/// API notes:
90+
/// <list type="bullet">
91+
/// <item>Includes <see cref="Score.Beatmap"/></item>
92+
/// <item>Includes <see cref="Score.BeatmapSet"/></item>
93+
/// </list>
8394
/// API docs:<br/>
8495
/// <a href="https://osu.ppy.sh/docs/index.html#get-user-beatmaps"/>
8596
/// </summary>

osu.NET/Models/Scores/Score.cs

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
using Newtonsoft.Json;
22
using osu.NET.Enums;
3+
using osu.NET.Models.Beatmaps;
4+
using osu.NET.Models.Matches;
5+
using osu.NET.Models.Users;
36

47
namespace osu.NET.Models.Scores;
58

@@ -11,6 +14,8 @@ namespace osu.NET.Models.Scores;
1114
/// </summary>
1215
public class Score
1316
{
17+
#region Default Attributes
18+
1419
/// <summary>
1520
/// The accuracy of this score.
1621
/// </summary>
@@ -173,4 +178,60 @@ public class Score
173178
/// </summary>
174179
[JsonProperty("ranked")]
175180
public bool IsRanked { get; private set; }
181+
182+
#endregion
183+
184+
#region Available Attributes
185+
186+
/// <summary>
187+
/// The beatmap this score was set on. This is an optional property and may be null.
188+
/// </summary>
189+
[JsonProperty("beatmap")]
190+
public BeatmapExtended? Beatmap { get; private set; }
191+
192+
/// <summary>
193+
/// The beatmapset this score's beatmap belongs to. This is an optional property and may be null.
194+
/// </summary>
195+
[JsonProperty("beatmapset")]
196+
public BeatmapSet? BeatmapSet { get; private set; }
197+
198+
/// <summary>
199+
/// The legacy match this score was set in. This is an optional property and will be null if this is not a legacy multiplayer score.
200+
/// </summary>
201+
[JsonProperty("match")]
202+
public Match? Match { get; private set; }
203+
204+
/// <summary>
205+
/// The position of this score on the leaderboard of the playlist. This is an optional property and will be null if the score is not set in the scope of a playlist.
206+
/// </summary>
207+
[JsonProperty("position")]
208+
public int? Position { get; private set; }
209+
210+
/// <summary>
211+
/// The position of this score on the country leaderboard of the beatmap. This is an optional property and will be null if the beatmap does not have leaderboards.
212+
/// </summary>
213+
[JsonProperty("rank_country")]
214+
public int? CountryRank { get; private set; }
215+
216+
/// <summary>
217+
/// The position of this score on the global leaderboard of the beatmap. This is an optional property and will be null if the beatmap does not have leaderboards.
218+
/// </summary>
219+
[JsonProperty("rank_global")]
220+
public int? GlobalRank { get; private set; }
221+
222+
// TODO: Add "scores_around" (probably will be implemented here along with multiplayer endpoints)
223+
224+
/// <summary>
225+
/// The user that set this score. This is an optional property and may be null.
226+
/// </summary>
227+
[JsonProperty("user")]
228+
public User? User { get; private set; }
229+
230+
/// <summary>
231+
/// The weight of this score in the player's overall performance. This is an optional property and may be null.
232+
/// </summary>
233+
[JsonProperty("weight")]
234+
public double Weight { get; private set; }
235+
236+
#endregion
176237
}

0 commit comments

Comments
 (0)