Skip to content

Commit

Permalink
feat!: add field Score::total_score_without_mods (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxOhn authored Jul 18, 2024
1 parent c17576c commit 5ed96a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/model/score.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ pub struct Score {
pub score: u32,
pub replay: bool,
pub current_user_attributes: UserAttributes,
pub total_score_without_mods: Option<u32>,
#[cfg_attr(feature = "serialize", serde(rename = "beatmap"))]
pub map: Option<Box<BeatmapExtended>>,
#[cfg_attr(feature = "serialize", serde(rename = "beatmapset"))]
Expand Down Expand Up @@ -139,6 +140,7 @@ impl<'de> Deserialize<'de> for Score {
score: u32,
replay: bool,
current_user_attributes: UserAttributes,
total_score_without_mods: Option<u32>,
#[serde(rename = "beatmap")]
map: Option<Box<BeatmapExtended>>,
#[serde(rename = "beatmapset")]
Expand Down Expand Up @@ -208,6 +210,7 @@ impl<'de> Deserialize<'de> for Score {
score: score_raw.score,
replay: score_raw.replay,
current_user_attributes: score_raw.current_user_attributes,
total_score_without_mods: score_raw.total_score_without_mods,
map: score_raw.map,
mapset: score_raw.mapset,
rank_global: score_raw.rank_global,
Expand Down
1 change: 1 addition & 0 deletions tests/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ mod types {
grade: Grade::A,
map_id: 123,
max_combo: 1234,
total_score_without_mods: Some(987_654),
map: Some(Box::new(get_map())),
mapset: Some(Box::new(get_mapset_compact())),
mode: GameMode::Catch,
Expand Down

0 comments on commit 5ed96a6

Please sign in to comment.