Skip to content

Commit c5a2ed9

Browse files
committed
Fix type of Score.weight
1 parent 99403bb commit c5a2ed9

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

osu.NET/Models/Scores/PPWeight.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using Newtonsoft.Json;
2+
3+
namespace osu.NET.Models.Scores;
4+
5+
/// <summary>
6+
/// Represents the weighting of a score in a users' overall performance.
7+
/// <br/><br/>
8+
/// API docs: <a href="https://osu.ppy.sh/docs/index.html#score"/><br/>
9+
/// Source: <a href="https://github.com/ppy/osu-web/blob/master/resources/js/interfaces/score-json.ts"/>
10+
/// </summary>
11+
public class PPWeight
12+
{
13+
/// <summary>
14+
/// The amount of weighted PP the score contributes.
15+
/// </summary>
16+
[JsonProperty("pp")]
17+
public float PP { get; private set; }
18+
19+
/// <summary>
20+
/// The weight percentage.
21+
/// </summary>
22+
[JsonProperty("percentage")]
23+
public float Percentage { get; private set; }
24+
}

osu.NET/Models/Scores/Score.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ public class Score
231231
/// The weight of this score in the player's overall performance. This is an optional property and may be null.
232232
/// </summary>
233233
[JsonProperty("weight")]
234-
public double Weight { get; private set; }
234+
public PPWeight? Weight { get; private set; }
235235

236236
#endregion
237237
}

0 commit comments

Comments
 (0)