From 907499f73afacb8cb419fbc2553d04cc26c0bd57 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Mon, 15 Nov 2021 16:06:29 +0900 Subject: [PATCH] Add json properties to difficulty attributes --- .../Difficulty/CatchDifficultyAttributes.cs | 2 ++ .../Difficulty/ManiaDifficultyAttributes.cs | 4 ++++ .../Difficulty/OsuDifficultyAttributes.cs | 20 +++++++++++++++++++ .../Difficulty/TaikoDifficultyAttributes.cs | 10 ++++++++++ .../Difficulty/DifficultyAttributes.cs | 7 +++++++ 5 files changed, 43 insertions(+) diff --git a/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyAttributes.cs b/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyAttributes.cs index 4e05b1e3e0..57305ce62b 100644 --- a/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyAttributes.cs +++ b/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyAttributes.cs @@ -1,12 +1,14 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using Newtonsoft.Json; using osu.Game.Rulesets.Difficulty; namespace osu.Game.Rulesets.Catch.Difficulty { public class CatchDifficultyAttributes : DifficultyAttributes { + [JsonProperty("approach_rate")] public double ApproachRate { get; set; } } } diff --git a/osu.Game.Rulesets.Mania/Difficulty/ManiaDifficultyAttributes.cs b/osu.Game.Rulesets.Mania/Difficulty/ManiaDifficultyAttributes.cs index 628d77107f..dd966ca859 100644 --- a/osu.Game.Rulesets.Mania/Difficulty/ManiaDifficultyAttributes.cs +++ b/osu.Game.Rulesets.Mania/Difficulty/ManiaDifficultyAttributes.cs @@ -1,13 +1,17 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using Newtonsoft.Json; using osu.Game.Rulesets.Difficulty; namespace osu.Game.Rulesets.Mania.Difficulty { public class ManiaDifficultyAttributes : DifficultyAttributes { + [JsonProperty("great_hit_window")] public double GreatHitWindow { get; set; } + + [JsonProperty("score_multiplier")] public double ScoreMultiplier { get; set; } } } diff --git a/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyAttributes.cs b/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyAttributes.cs index e0a216c8e0..323cda76d4 100644 --- a/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyAttributes.cs +++ b/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyAttributes.cs @@ -1,21 +1,41 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using Newtonsoft.Json; using osu.Game.Rulesets.Difficulty; namespace osu.Game.Rulesets.Osu.Difficulty { public class OsuDifficultyAttributes : DifficultyAttributes { + [JsonProperty("aim_strain")] public double AimStrain { get; set; } + + [JsonProperty("speed_strain")] public double SpeedStrain { get; set; } + + [JsonProperty("flashlight_rating")] public double FlashlightRating { get; set; } + + [JsonProperty("slider_factor")] public double SliderFactor { get; set; } + + [JsonProperty("approach_rate")] public double ApproachRate { get; set; } + + [JsonProperty("overall_difficulty")] public double OverallDifficulty { get; set; } + + [JsonProperty("drain_rate")] public double DrainRate { get; set; } + + [JsonProperty("hit_circle_count")] public int HitCircleCount { get; set; } + + [JsonProperty("slider_count")] public int SliderCount { get; set; } + + [JsonProperty("spinner_count")] public int SpinnerCount { get; set; } } } diff --git a/osu.Game.Rulesets.Taiko/Difficulty/TaikoDifficultyAttributes.cs b/osu.Game.Rulesets.Taiko/Difficulty/TaikoDifficultyAttributes.cs index 36adbd5a5b..171ac89e6f 100644 --- a/osu.Game.Rulesets.Taiko/Difficulty/TaikoDifficultyAttributes.cs +++ b/osu.Game.Rulesets.Taiko/Difficulty/TaikoDifficultyAttributes.cs @@ -1,16 +1,26 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using Newtonsoft.Json; using osu.Game.Rulesets.Difficulty; namespace osu.Game.Rulesets.Taiko.Difficulty { public class TaikoDifficultyAttributes : DifficultyAttributes { + [JsonProperty("stamina_strain")] public double StaminaStrain { get; set; } + + [JsonProperty("rhythm_strain")] public double RhythmStrain { get; set; } + + [JsonProperty("colour_strain")] public double ColourStrain { get; set; } + + [JsonProperty("approach_rate")] public double ApproachRate { get; set; } + + [JsonProperty("great_hit_window")] public double GreatHitWindow { get; set; } } } diff --git a/osu.Game/Rulesets/Difficulty/DifficultyAttributes.cs b/osu.Game/Rulesets/Difficulty/DifficultyAttributes.cs index 6bb780a68b..fb67396718 100644 --- a/osu.Game/Rulesets/Difficulty/DifficultyAttributes.cs +++ b/osu.Game/Rulesets/Difficulty/DifficultyAttributes.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using Newtonsoft.Json; using osu.Game.Rulesets.Difficulty.Skills; using osu.Game.Rulesets.Mods; @@ -8,10 +9,16 @@ namespace osu.Game.Rulesets.Difficulty { public class DifficultyAttributes { + [JsonIgnore] public Mod[] Mods { get; set; } + + [JsonIgnore] public Skill[] Skills { get; set; } + [JsonProperty("star_rating")] public double StarRating { get; set; } + + [JsonProperty("max_combo")] public int MaxCombo { get; set; } public DifficultyAttributes()