diff --git a/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyAttributes.cs b/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyAttributes.cs index 5c64643fd4d0..80bf2234724c 100644 --- a/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyAttributes.cs +++ b/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyAttributes.cs @@ -8,7 +8,7 @@ namespace osu.Game.Rulesets.Catch.Difficulty { - public class CatchDifficultyAttributes : DifficultyAttributes + public interface ICatchDifficultyAttributes : IDifficultyAttributes { /// /// The perceived approach rate inclusive of rate-adjusting mods (DT/HT/etc). @@ -16,6 +16,12 @@ public class CatchDifficultyAttributes : DifficultyAttributes /// /// Rate-adjusting mods don't directly affect the approach rate difficulty value, but have a perceived effect as a result of adjusting audio timing. /// + public double ApproachRate { get; set; } + } + + public class CatchDifficultyAttributes : DifficultyAttributes, ICatchDifficultyAttributes + { + /// [JsonProperty("approach_rate")] public double ApproachRate { get; set; } diff --git a/osu.Game.Rulesets.Catch/Difficulty/CatchPerformanceAttributes.cs b/osu.Game.Rulesets.Catch/Difficulty/CatchPerformanceAttributes.cs index 1335fc2d2341..caa622e99188 100644 --- a/osu.Game.Rulesets.Catch/Difficulty/CatchPerformanceAttributes.cs +++ b/osu.Game.Rulesets.Catch/Difficulty/CatchPerformanceAttributes.cs @@ -5,7 +5,11 @@ namespace osu.Game.Rulesets.Catch.Difficulty { - public class CatchPerformanceAttributes : PerformanceAttributes + public interface ICatchPerformanceAttributes : IPerformanceAttributes + { + } + + public class CatchPerformanceAttributes : PerformanceAttributes, ICatchPerformanceAttributes { } } diff --git a/osu.Game.Rulesets.Mania/Difficulty/ManiaDifficultyAttributes.cs b/osu.Game.Rulesets.Mania/Difficulty/ManiaDifficultyAttributes.cs index db60e757e111..78494272b506 100644 --- a/osu.Game.Rulesets.Mania/Difficulty/ManiaDifficultyAttributes.cs +++ b/osu.Game.Rulesets.Mania/Difficulty/ManiaDifficultyAttributes.cs @@ -8,7 +8,7 @@ namespace osu.Game.Rulesets.Mania.Difficulty { - public class ManiaDifficultyAttributes : DifficultyAttributes + public interface IManiaDifficultyAttributes : IDifficultyAttributes { /// /// The hit window for a GREAT hit inclusive of rate-adjusting mods (DT/HT/etc). @@ -16,6 +16,12 @@ public class ManiaDifficultyAttributes : DifficultyAttributes /// /// Rate-adjusting mods do not affect the hit window at all in osu-stable. /// + public double GreatHitWindow { get; set; } + } + + public class ManiaDifficultyAttributes : DifficultyAttributes, IManiaDifficultyAttributes + { + /// [JsonProperty("great_hit_window")] public double GreatHitWindow { get; set; } diff --git a/osu.Game.Rulesets.Mania/Difficulty/ManiaPerformanceAttributes.cs b/osu.Game.Rulesets.Mania/Difficulty/ManiaPerformanceAttributes.cs index 64f8b026c2aa..0557e8674359 100644 --- a/osu.Game.Rulesets.Mania/Difficulty/ManiaPerformanceAttributes.cs +++ b/osu.Game.Rulesets.Mania/Difficulty/ManiaPerformanceAttributes.cs @@ -7,8 +7,14 @@ namespace osu.Game.Rulesets.Mania.Difficulty { - public class ManiaPerformanceAttributes : PerformanceAttributes + public interface IManiaPerformanceAttributes : IPerformanceAttributes { + public double Difficulty { get; set; } + } + + public class ManiaPerformanceAttributes : PerformanceAttributes, IManiaPerformanceAttributes + { + /// [JsonProperty("difficulty")] public double Difficulty { get; set; } diff --git a/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyAttributes.cs b/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyAttributes.cs index a3c0209a08f3..53045baf05d7 100644 --- a/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyAttributes.cs +++ b/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyAttributes.cs @@ -11,31 +11,27 @@ namespace osu.Game.Rulesets.Osu.Difficulty { - public class OsuDifficultyAttributes : DifficultyAttributes + public interface IOsuDifficultyAttributes : IDifficultyAttributes { /// /// The difficulty corresponding to the aim skill. /// - [JsonProperty("aim_difficulty")] public double AimDifficulty { get; set; } /// /// The difficulty corresponding to the speed skill. /// - [JsonProperty("speed_difficulty")] public double SpeedDifficulty { get; set; } /// /// The number of clickable objects weighted by difficulty. /// Related to /// - [JsonProperty("speed_note_count")] public double SpeedNoteCount { get; set; } /// /// The difficulty corresponding to the flashlight skill. /// - [JsonProperty("flashlight_difficulty")] public double FlashlightDifficulty { get; set; } /// @@ -43,13 +39,10 @@ public class OsuDifficultyAttributes : DifficultyAttributes /// A value closer to 1.0 indicates most of is contributed by hitcircles. /// A value closer to 0.0 indicates most of is contributed by sliders. /// - [JsonProperty("slider_factor")] public double SliderFactor { get; set; } - [JsonProperty("aim_difficult_strain_count")] public double AimDifficultStrainCount { get; set; } - [JsonProperty("speed_difficult_strain_count")] public double SpeedDifficultStrainCount { get; set; } /// @@ -58,7 +51,6 @@ public class OsuDifficultyAttributes : DifficultyAttributes /// /// Rate-adjusting mods don't directly affect the approach rate difficulty value, but have a perceived effect as a result of adjusting audio timing. /// - [JsonProperty("approach_rate")] public double ApproachRate { get; set; } /// @@ -67,7 +59,6 @@ public class OsuDifficultyAttributes : DifficultyAttributes /// /// Rate-adjusting mods don't directly affect the overall difficulty value, but have a perceived effect as a result of adjusting audio timing. /// - [JsonProperty("overall_difficulty")] public double OverallDifficulty { get; set; } /// @@ -89,6 +80,57 @@ public class OsuDifficultyAttributes : DifficultyAttributes /// The number of spinners in the beatmap. /// public int SpinnerCount { get; set; } + } + + public class OsuDifficultyAttributes : DifficultyAttributes, IOsuDifficultyAttributes + { + /// + [JsonProperty("aim_difficulty")] + public double AimDifficulty { get; set; } + + /// + [JsonProperty("speed_difficulty")] + public double SpeedDifficulty { get; set; } + + /// + [JsonProperty("speed_note_count")] + public double SpeedNoteCount { get; set; } + + /// + [JsonProperty("flashlight_difficulty")] + public double FlashlightDifficulty { get; set; } + + /// + [JsonProperty("slider_factor")] + public double SliderFactor { get; set; } + + /// + [JsonProperty("aim_difficult_strain_count")] + public double AimDifficultStrainCount { get; set; } + + /// + [JsonProperty("speed_difficult_strain_count")] + public double SpeedDifficultStrainCount { get; set; } + + /// + [JsonProperty("approach_rate")] + public double ApproachRate { get; set; } + + /// + [JsonProperty("overall_difficulty")] + public double OverallDifficulty { get; set; } + + /// + public double DrainRate { get; set; } + + /// + public int HitCircleCount { get; set; } + + /// + public int SliderCount { get; set; } + + /// + public int SpinnerCount { get; set; } public override IEnumerable<(int attributeId, object value)> ToDatabaseAttributes() { diff --git a/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceAttributes.cs b/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceAttributes.cs index 0aeaf7669f68..602b5f59e1ca 100644 --- a/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceAttributes.cs +++ b/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceAttributes.cs @@ -7,20 +7,38 @@ namespace osu.Game.Rulesets.Osu.Difficulty { - public class OsuPerformanceAttributes : PerformanceAttributes + public interface IOsuPerformanceAttributes : IPerformanceAttributes { + public double Aim { get; set; } + + public double Speed { get; set; } + + public double Accuracy { get; set; } + + public double Flashlight { get; set; } + + public double EffectiveMissCount { get; set; } + } + + public class OsuPerformanceAttributes : PerformanceAttributes, IOsuPerformanceAttributes + { + /// [JsonProperty("aim")] public double Aim { get; set; } + /// [JsonProperty("speed")] public double Speed { get; set; } + /// [JsonProperty("accuracy")] public double Accuracy { get; set; } + /// [JsonProperty("flashlight")] public double Flashlight { get; set; } + /// [JsonProperty("effective_miss_count")] public double EffectiveMissCount { get; set; } diff --git a/osu.Game.Rulesets.Taiko/Difficulty/TaikoDifficultyAttributes.cs b/osu.Game.Rulesets.Taiko/Difficulty/TaikoDifficultyAttributes.cs index c8f0448767e8..7c420b9bddd2 100644 --- a/osu.Game.Rulesets.Taiko/Difficulty/TaikoDifficultyAttributes.cs +++ b/osu.Game.Rulesets.Taiko/Difficulty/TaikoDifficultyAttributes.cs @@ -8,36 +8,31 @@ namespace osu.Game.Rulesets.Taiko.Difficulty { - public class TaikoDifficultyAttributes : DifficultyAttributes + public interface ITaikoDifficultyAttributes : IDifficultyAttributes { /// /// The difficulty corresponding to the stamina skill. /// - [JsonProperty("stamina_difficulty")] public double StaminaDifficulty { get; set; } /// /// The ratio of stamina difficulty from mono-color (single colour) streams to total stamina difficulty. /// - [JsonProperty("mono_stamina_factor")] public double MonoStaminaFactor { get; set; } /// /// The difficulty corresponding to the rhythm skill. /// - [JsonProperty("rhythm_difficulty")] public double RhythmDifficulty { get; set; } /// /// The difficulty corresponding to the colour skill. /// - [JsonProperty("colour_difficulty")] public double ColourDifficulty { get; set; } /// /// The difficulty corresponding to the hardest parts of the map. /// - [JsonProperty("peak_difficulty")] public double PeakDifficulty { get; set; } /// @@ -46,7 +41,6 @@ public class TaikoDifficultyAttributes : DifficultyAttributes /// /// Rate-adjusting mods don't directly affect the hit window, but have a perceived effect as a result of adjusting audio timing. /// - [JsonProperty("great_hit_window")] public double GreatHitWindow { get; set; } /// @@ -55,6 +49,36 @@ public class TaikoDifficultyAttributes : DifficultyAttributes /// /// Rate-adjusting mods don't directly affect the hit window, but have a perceived effect as a result of adjusting audio timing. /// + public double OkHitWindow { get; set; } + } + + public class TaikoDifficultyAttributes : DifficultyAttributes, ITaikoDifficultyAttributes + { + /// + [JsonProperty("stamina_difficulty")] + public double StaminaDifficulty { get; set; } + + /// + [JsonProperty("mono_stamina_factor")] + public double MonoStaminaFactor { get; set; } + + /// + [JsonProperty("rhythm_difficulty")] + public double RhythmDifficulty { get; set; } + + /// + [JsonProperty("colour_difficulty")] + public double ColourDifficulty { get; set; } + + /// + [JsonProperty("peak_difficulty")] + public double PeakDifficulty { get; set; } + + /// + [JsonProperty("great_hit_window")] + public double GreatHitWindow { get; set; } + + /// [JsonProperty("ok_hit_window")] public double OkHitWindow { get; set; } diff --git a/osu.Game.Rulesets.Taiko/Difficulty/TaikoPerformanceAttributes.cs b/osu.Game.Rulesets.Taiko/Difficulty/TaikoPerformanceAttributes.cs index 7c74e43db19a..584c5b0ace5b 100644 --- a/osu.Game.Rulesets.Taiko/Difficulty/TaikoPerformanceAttributes.cs +++ b/osu.Game.Rulesets.Taiko/Difficulty/TaikoPerformanceAttributes.cs @@ -7,17 +7,32 @@ namespace osu.Game.Rulesets.Taiko.Difficulty { - public class TaikoPerformanceAttributes : PerformanceAttributes + public interface ITaikoPerformanceAttributes : IPerformanceAttributes { + public double Difficulty { get; set; } + + public double Accuracy { get; set; } + + public double EffectiveMissCount { get; set; } + + public double? EstimatedUnstableRate { get; set; } + } + + public class TaikoPerformanceAttributes : PerformanceAttributes, ITaikoPerformanceAttributes + { + /// [JsonProperty("difficulty")] public double Difficulty { get; set; } + /// [JsonProperty("accuracy")] public double Accuracy { get; set; } + /// [JsonProperty("effective_miss_count")] public double EffectiveMissCount { get; set; } + /// [JsonProperty("estimated_unstable_rate")] public double? EstimatedUnstableRate { get; set; } diff --git a/osu.Game/Rulesets/Difficulty/DifficultyAttributes.cs b/osu.Game/Rulesets/Difficulty/DifficultyAttributes.cs index 7b6bc37a61f2..f42c8c370f76 100644 --- a/osu.Game/Rulesets/Difficulty/DifficultyAttributes.cs +++ b/osu.Game/Rulesets/Difficulty/DifficultyAttributes.cs @@ -9,11 +9,24 @@ namespace osu.Game.Rulesets.Difficulty { + public interface IDifficultyAttributes + { + /// + /// The combined star rating of all skills. + /// + public double StarRating { get; set; } + + /// + /// The maximum achievable combo. + /// + public int MaxCombo { get; set; } + } + /// /// Describes the difficulty of a beatmap, as output by a . /// [JsonObject(MemberSerialization.OptIn)] - public class DifficultyAttributes + public class DifficultyAttributes : IDifficultyAttributes { protected const int ATTRIB_ID_AIM = 1; protected const int ATTRIB_ID_SPEED = 3; @@ -36,15 +49,11 @@ public class DifficultyAttributes /// public Mod[] Mods { get; set; } = Array.Empty(); - /// - /// The combined star rating of all skills. - /// + /// /> [JsonProperty("star_rating", Order = -3)] public double StarRating { get; set; } - /// - /// The maximum achievable combo. - /// + /// /> [JsonProperty("max_combo", Order = -2)] public int MaxCombo { get; set; } diff --git a/osu.Game/Rulesets/Difficulty/PerformanceAttributes.cs b/osu.Game/Rulesets/Difficulty/PerformanceAttributes.cs index e8c4c71913b3..9695f436a05d 100644 --- a/osu.Game/Rulesets/Difficulty/PerformanceAttributes.cs +++ b/osu.Game/Rulesets/Difficulty/PerformanceAttributes.cs @@ -6,11 +6,17 @@ namespace osu.Game.Rulesets.Difficulty { - public class PerformanceAttributes + public interface IPerformanceAttributes { /// /// Calculated score performance points. /// + public double Total { get; set; } + } + + public class PerformanceAttributes : IPerformanceAttributes + { + /// [JsonProperty("pp")] public double Total { get; set; }