From b795532aa5db67c7c0e5242c3607dcede7b9fbc1 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Dec 2019 19:43:16 +0800 Subject: [PATCH 01/15] add difficulty adjustment mods --- osu.Game.Rulesets.Catch/CatchRuleset.cs | 6 +++ .../Mods/CatchModDifficultyAdjust.cs | 51 ++++++++++++++++++ osu.Game.Rulesets.Mania/ManiaRuleset.cs | 1 + .../Mods/ManiaModDifficultyAdjust.cs | 22 ++++++++ .../Mods/OsuModDifficultyAdjust.cs | 52 +++++++++++++++++++ osu.Game.Rulesets.Osu/OsuRuleset.cs | 1 + .../Mods/TaikoModDifficultyAdjust.cs | 42 +++++++++++++++ osu.Game.Rulesets.Taiko/TaikoRuleset.cs | 6 +++ osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs | 43 +++++++++++++++ 9 files changed, 224 insertions(+) create mode 100644 osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs create mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModDifficultyAdjust.cs create mode 100644 osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs create mode 100644 osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs create mode 100644 osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index 71d68ace94..6495c5379b 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -98,6 +98,12 @@ namespace osu.Game.Rulesets.Catch new CatchModFlashlight(), }; + case ModType.Conversion: + return new Mod[] + { + new CatchModDifficultyAdjust(), + }; + case ModType.Automation: return new Mod[] { diff --git a/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs b/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs new file mode 100644 index 0000000000..7dfd5e8964 --- /dev/null +++ b/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs @@ -0,0 +1,51 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Bindables; +using osu.Game.Beatmaps; +using osu.Game.Configuration; +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Catch.Mods +{ + public class CatchModDifficultyAdjust : ModDifficultyAdjust + { + [SettingSource("Drain Rate", "Override the beatmap's set HP")] + public override BindableNumber DrainRate { get; } = new BindableFloat + { + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + Precision = 1F, + }; + + [SettingSource("Fruit Size", "Override the beatmap's set CS")] + public override BindableNumber CircleSize { get; } = new BindableFloat + { + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + Precision = 0.1F, + }; + + [SettingSource("Approach Rate", "Override the beatmap's set AR")] + public override BindableNumber ApproachRate { get; } = new BindableFloat + { + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + Precision = 0.1F, + }; + + public override void ApplyToDifficulty(BeatmapDifficulty difficulty) + { + difficulty.DrainRate = DrainRate.Value; + difficulty.CircleSize = CircleSize.Value; + difficulty.ApproachRate = ApproachRate.Value; + difficulty.OverallDifficulty = ApproachRate.Value; + } + } +} \ No newline at end of file diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index c74a292331..c4908d1993 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -143,6 +143,7 @@ namespace osu.Game.Rulesets.Mania new ManiaModRandom(), new ManiaModDualStages(), new ManiaModMirror(), + new ManiaModDifficultyAdjust(), }; case ModType.Automation: diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModDifficultyAdjust.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModDifficultyAdjust.cs new file mode 100644 index 0000000000..67e464f7d8 --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModDifficultyAdjust.cs @@ -0,0 +1,22 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Bindables; +using osu.Game.Configuration; +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Mania.Mods +{ + public class ManiaModDifficultyAdjust : ModDifficultyAdjust + { + [SettingSource("Overall Difficulty", "Override the beatmap's set OD")] + public override BindableNumber OverallDifficulty { get; } = new BindableFloat + { + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + Precision = 0.1F, + }; + } +} \ No newline at end of file diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs b/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs new file mode 100644 index 0000000000..6851fe0d0a --- /dev/null +++ b/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs @@ -0,0 +1,52 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Bindables; +using osu.Game.Configuration; +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Osu.Mods +{ + public class OsuModDifficultyAdjust : ModDifficultyAdjust + { + [SettingSource("Drain Rate", "Override the beatmap's set HP")] + public override BindableNumber DrainRate { get; } = new BindableFloat + { + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + Precision = 0.1F, + }; + + [SettingSource("Circle Size", "Override the beatmap's set CS")] + public override BindableNumber CircleSize { get; } = new BindableFloat + { + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + Precision = 0.1F, + }; + + [SettingSource("Approach Rate", "Override the beatmap's set AR")] + public override BindableNumber ApproachRate { get; } = new BindableFloat + { + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + Precision = 0.1F, + }; + + [SettingSource("Overall Difficulty", "Override the beatmap's set OD")] + public override BindableNumber OverallDifficulty { get; } = new BindableFloat + { + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + Precision = 0.1F, + }; + } +} \ No newline at end of file diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index fa69cec78d..746876b217 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -121,6 +121,7 @@ namespace osu.Game.Rulesets.Osu return new Mod[] { new OsuModTarget(), + new OsuModDifficultyAdjust(), }; case ModType.Automation: diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs new file mode 100644 index 0000000000..611f74f707 --- /dev/null +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs @@ -0,0 +1,42 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Bindables; +using osu.Game.Configuration; +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Taiko.Mods +{ + public class TaikoModDifficultyAdjust : ModDifficultyAdjust + { + [SettingSource("Drain Rate", "Override the beatmap's set HP")] + public override BindableNumber DrainRate { get; } = new BindableFloat + { + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + Precision = 0.1F, + }; + + [SettingSource("Approach Rate", "Override the beatmap's set AR")] + public override BindableNumber ApproachRate { get; } = new BindableFloat + { + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + Precision = 0.1F, + }; + + [SettingSource("Overall Difficulty", "Override the beatmap's set OD")] + public override BindableNumber OverallDifficulty { get; } = new BindableFloat + { + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + Precision = 0.1F, + }; + } +} \ No newline at end of file diff --git a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs index b2655f592c..c4c85c183b 100644 --- a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs @@ -97,6 +97,12 @@ namespace osu.Game.Rulesets.Taiko new TaikoModFlashlight(), }; + case ModType.Conversion: + return new Mod[] + { + new TaikoModDifficultyAdjust(), + }; + case ModType.Automation: return new Mod[] { diff --git a/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs b/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs new file mode 100644 index 0000000000..6e7233e4d0 --- /dev/null +++ b/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs @@ -0,0 +1,43 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Game.Beatmaps; +using osu.Framework.Bindables; +using osu.Framework.Graphics.Sprites; +using System; + +namespace osu.Game.Rulesets.Mods +{ + public abstract class ModDifficultyAdjust : Mod, IApplicableToDifficulty + { + public override string Name => @"Difficulty Adjust"; + + public override string Description => @"Override a beatmap's difficulty settings"; + + public override string Acronym => "DA"; + + public override ModType Type => ModType.Conversion; + + public override IconUsage Icon => FontAwesome.Solid.Hammer; + + public override double ScoreMultiplier => 1.0; + + public override Type[] IncompatibleMods => new[] { typeof(ModEasy), typeof(ModHardRock) }; + + public virtual BindableNumber DrainRate { get; } + + public virtual BindableNumber CircleSize { get; } + + public virtual BindableNumber ApproachRate { get; } + + public virtual BindableNumber OverallDifficulty { get; } + + public virtual void ApplyToDifficulty(BeatmapDifficulty difficulty) + { + difficulty.DrainRate = DrainRate != null ? DrainRate.Value : difficulty.DrainRate; + difficulty.CircleSize = CircleSize != null ? CircleSize.Value : difficulty.CircleSize; + difficulty.ApproachRate = ApproachRate != null ? ApproachRate.Value : difficulty.ApproachRate; + difficulty.OverallDifficulty = OverallDifficulty != null ? OverallDifficulty.Value: difficulty.OverallDifficulty; + } + } +} \ No newline at end of file From be3634cce16a53eca471d185218f5b168002a5e7 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Dec 2019 20:02:23 +0800 Subject: [PATCH 02/15] remove ApproachRate setting --- .../Mods/TaikoModDifficultyAdjust.cs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs index 611f74f707..7b7bc69aad 100644 --- a/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs @@ -19,16 +19,6 @@ namespace osu.Game.Rulesets.Taiko.Mods Precision = 0.1F, }; - [SettingSource("Approach Rate", "Override the beatmap's set AR")] - public override BindableNumber ApproachRate { get; } = new BindableFloat - { - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - Precision = 0.1F, - }; - [SettingSource("Overall Difficulty", "Override the beatmap's set OD")] public override BindableNumber OverallDifficulty { get; } = new BindableFloat { From b0cf44c3bedfa3973be04befbbd1b56771206acc Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Dec 2019 20:12:29 +0800 Subject: [PATCH 03/15] fix appveyor issues --- osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs | 2 +- osu.Game.Rulesets.Mania/Mods/ManiaModDifficultyAdjust.cs | 2 +- osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs | 2 +- osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs | 2 +- osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs b/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs index 7dfd5e8964..6643ebadf1 100644 --- a/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs +++ b/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs @@ -48,4 +48,4 @@ namespace osu.Game.Rulesets.Catch.Mods difficulty.OverallDifficulty = ApproachRate.Value; } } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModDifficultyAdjust.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModDifficultyAdjust.cs index 67e464f7d8..67554e6b92 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModDifficultyAdjust.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModDifficultyAdjust.cs @@ -19,4 +19,4 @@ namespace osu.Game.Rulesets.Mania.Mods Precision = 0.1F, }; } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs b/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs index 6851fe0d0a..86ab4579bb 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs @@ -49,4 +49,4 @@ namespace osu.Game.Rulesets.Osu.Mods Precision = 0.1F, }; } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs index 7b7bc69aad..ed76cf77ac 100644 --- a/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs @@ -29,4 +29,4 @@ namespace osu.Game.Rulesets.Taiko.Mods Precision = 0.1F, }; } -} \ No newline at end of file +} diff --git a/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs b/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs index 6e7233e4d0..d1f6bf45b4 100644 --- a/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs +++ b/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs @@ -37,7 +37,7 @@ namespace osu.Game.Rulesets.Mods difficulty.DrainRate = DrainRate != null ? DrainRate.Value : difficulty.DrainRate; difficulty.CircleSize = CircleSize != null ? CircleSize.Value : difficulty.CircleSize; difficulty.ApproachRate = ApproachRate != null ? ApproachRate.Value : difficulty.ApproachRate; - difficulty.OverallDifficulty = OverallDifficulty != null ? OverallDifficulty.Value: difficulty.OverallDifficulty; + difficulty.OverallDifficulty = OverallDifficulty != null ? OverallDifficulty.Value : difficulty.OverallDifficulty; } } -} \ No newline at end of file +} From 472fa9822cc7409487935ea6e0657e8c52a38594 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Dec 2019 08:25:51 +0800 Subject: [PATCH 04/15] make ModDifficultyAdjust incompatible with ModEasy and ModHardRock --- osu.Game/Rulesets/Mods/ModEasy.cs | 2 +- osu.Game/Rulesets/Mods/ModHardRock.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Rulesets/Mods/ModEasy.cs b/osu.Game/Rulesets/Mods/ModEasy.cs index a55ebc51d6..7a34b2de3c 100644 --- a/osu.Game/Rulesets/Mods/ModEasy.cs +++ b/osu.Game/Rulesets/Mods/ModEasy.cs @@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Mods public override ModType Type => ModType.DifficultyReduction; public override double ScoreMultiplier => 0.5; public override bool Ranked => true; - public override Type[] IncompatibleMods => new[] { typeof(ModHardRock) }; + public override Type[] IncompatibleMods => new[] { typeof(ModHardRock), typeof(ModDifficultyAdjust) }; private int retries = 2; diff --git a/osu.Game/Rulesets/Mods/ModHardRock.cs b/osu.Game/Rulesets/Mods/ModHardRock.cs index 2044cbeae2..2bcac3e4a9 100644 --- a/osu.Game/Rulesets/Mods/ModHardRock.cs +++ b/osu.Game/Rulesets/Mods/ModHardRock.cs @@ -15,7 +15,7 @@ namespace osu.Game.Rulesets.Mods public override IconUsage Icon => OsuIcon.ModHardrock; public override ModType Type => ModType.DifficultyIncrease; public override string Description => "Everything just got a bit harder..."; - public override Type[] IncompatibleMods => new[] { typeof(ModEasy) }; + public override Type[] IncompatibleMods => new[] { typeof(ModEasy), typeof(ModDifficultyAdjust) }; public void ApplyToDifficulty(BeatmapDifficulty difficulty) { From 002a125b4aee43b6eac28581a784ffe1fecd21bd Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Dec 2019 21:14:26 +0800 Subject: [PATCH 05/15] make ModDifficultyAdjust generic --- osu.Game.Rulesets.Catch/CatchRuleset.cs | 2 +- .../Mods/CatchModDifficultyAdjust.cs | 51 ------------------ osu.Game.Rulesets.Mania/ManiaRuleset.cs | 2 +- .../Mods/ManiaModDifficultyAdjust.cs | 22 -------- .../Mods/OsuModDifficultyAdjust.cs | 52 ------------------- osu.Game.Rulesets.Osu/OsuRuleset.cs | 2 +- .../Mods/TaikoModDifficultyAdjust.cs | 32 ------------ osu.Game.Rulesets.Taiko/TaikoRuleset.cs | 2 +- osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs | 51 ++++++++++++++---- 9 files changed, 46 insertions(+), 170 deletions(-) delete mode 100644 osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs delete mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModDifficultyAdjust.cs delete mode 100644 osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs delete mode 100644 osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index 6495c5379b..5973eea602 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -101,7 +101,7 @@ namespace osu.Game.Rulesets.Catch case ModType.Conversion: return new Mod[] { - new CatchModDifficultyAdjust(), + new ModDifficultyAdjust(), }; case ModType.Automation: diff --git a/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs b/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs deleted file mode 100644 index 6643ebadf1..0000000000 --- a/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -using osu.Framework.Bindables; -using osu.Game.Beatmaps; -using osu.Game.Configuration; -using osu.Game.Rulesets.Mods; - -namespace osu.Game.Rulesets.Catch.Mods -{ - public class CatchModDifficultyAdjust : ModDifficultyAdjust - { - [SettingSource("Drain Rate", "Override the beatmap's set HP")] - public override BindableNumber DrainRate { get; } = new BindableFloat - { - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - Precision = 1F, - }; - - [SettingSource("Fruit Size", "Override the beatmap's set CS")] - public override BindableNumber CircleSize { get; } = new BindableFloat - { - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - Precision = 0.1F, - }; - - [SettingSource("Approach Rate", "Override the beatmap's set AR")] - public override BindableNumber ApproachRate { get; } = new BindableFloat - { - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - Precision = 0.1F, - }; - - public override void ApplyToDifficulty(BeatmapDifficulty difficulty) - { - difficulty.DrainRate = DrainRate.Value; - difficulty.CircleSize = CircleSize.Value; - difficulty.ApproachRate = ApproachRate.Value; - difficulty.OverallDifficulty = ApproachRate.Value; - } - } -} diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index c4908d1993..520bcfb586 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -143,7 +143,7 @@ namespace osu.Game.Rulesets.Mania new ManiaModRandom(), new ManiaModDualStages(), new ManiaModMirror(), - new ManiaModDifficultyAdjust(), + new ModDifficultyAdjust(), }; case ModType.Automation: diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModDifficultyAdjust.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModDifficultyAdjust.cs deleted file mode 100644 index 67554e6b92..0000000000 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModDifficultyAdjust.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -using osu.Framework.Bindables; -using osu.Game.Configuration; -using osu.Game.Rulesets.Mods; - -namespace osu.Game.Rulesets.Mania.Mods -{ - public class ManiaModDifficultyAdjust : ModDifficultyAdjust - { - [SettingSource("Overall Difficulty", "Override the beatmap's set OD")] - public override BindableNumber OverallDifficulty { get; } = new BindableFloat - { - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - Precision = 0.1F, - }; - } -} diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs b/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs deleted file mode 100644 index 86ab4579bb..0000000000 --- a/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -using osu.Framework.Bindables; -using osu.Game.Configuration; -using osu.Game.Rulesets.Mods; - -namespace osu.Game.Rulesets.Osu.Mods -{ - public class OsuModDifficultyAdjust : ModDifficultyAdjust - { - [SettingSource("Drain Rate", "Override the beatmap's set HP")] - public override BindableNumber DrainRate { get; } = new BindableFloat - { - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - Precision = 0.1F, - }; - - [SettingSource("Circle Size", "Override the beatmap's set CS")] - public override BindableNumber CircleSize { get; } = new BindableFloat - { - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - Precision = 0.1F, - }; - - [SettingSource("Approach Rate", "Override the beatmap's set AR")] - public override BindableNumber ApproachRate { get; } = new BindableFloat - { - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - Precision = 0.1F, - }; - - [SettingSource("Overall Difficulty", "Override the beatmap's set OD")] - public override BindableNumber OverallDifficulty { get; } = new BindableFloat - { - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - Precision = 0.1F, - }; - } -} diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 746876b217..b9fa14baa1 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -121,7 +121,7 @@ namespace osu.Game.Rulesets.Osu return new Mod[] { new OsuModTarget(), - new OsuModDifficultyAdjust(), + new ModDifficultyAdjust(), }; case ModType.Automation: diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs deleted file mode 100644 index ed76cf77ac..0000000000 --- a/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -using osu.Framework.Bindables; -using osu.Game.Configuration; -using osu.Game.Rulesets.Mods; - -namespace osu.Game.Rulesets.Taiko.Mods -{ - public class TaikoModDifficultyAdjust : ModDifficultyAdjust - { - [SettingSource("Drain Rate", "Override the beatmap's set HP")] - public override BindableNumber DrainRate { get; } = new BindableFloat - { - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - Precision = 0.1F, - }; - - [SettingSource("Overall Difficulty", "Override the beatmap's set OD")] - public override BindableNumber OverallDifficulty { get; } = new BindableFloat - { - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - Precision = 0.1F, - }; - } -} diff --git a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs index c4c85c183b..40ce58aeca 100644 --- a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs @@ -100,7 +100,7 @@ namespace osu.Game.Rulesets.Taiko case ModType.Conversion: return new Mod[] { - new TaikoModDifficultyAdjust(), + new ModDifficultyAdjust(), }; case ModType.Automation: diff --git a/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs b/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs index d1f6bf45b4..532da8a647 100644 --- a/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs +++ b/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs @@ -5,10 +5,11 @@ using osu.Game.Beatmaps; using osu.Framework.Bindables; using osu.Framework.Graphics.Sprites; using System; +using osu.Game.Configuration; namespace osu.Game.Rulesets.Mods { - public abstract class ModDifficultyAdjust : Mod, IApplicableToDifficulty + public class ModDifficultyAdjust : Mod, IApplicableToDifficulty { public override string Name => @"Difficulty Adjust"; @@ -24,20 +25,52 @@ namespace osu.Game.Rulesets.Mods public override Type[] IncompatibleMods => new[] { typeof(ModEasy), typeof(ModHardRock) }; - public virtual BindableNumber DrainRate { get; } + [SettingSource("Drain Rate", "Override the beatmap's set HP")] + public BindableNumber DrainRate { get; } = new BindableFloat + { + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + Precision = 0.1F, + }; - public virtual BindableNumber CircleSize { get; } + [SettingSource("Circle Size", "Override the beatmap's set CS")] + public BindableNumber CircleSize { get; } = new BindableFloat + { + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + Precision = 0.1F, + }; - public virtual BindableNumber ApproachRate { get; } + [SettingSource("Approach Rate", "Override the beatmap's set AR")] + public BindableNumber ApproachRate { get; } = new BindableFloat + { + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + Precision = 0.1F, + }; - public virtual BindableNumber OverallDifficulty { get; } + [SettingSource("Overall Difficulty", "Override the beatmap's set OD")] + public BindableNumber OverallDifficulty { get; } = new BindableFloat + { + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + Precision = 0.1F, + }; public virtual void ApplyToDifficulty(BeatmapDifficulty difficulty) { - difficulty.DrainRate = DrainRate != null ? DrainRate.Value : difficulty.DrainRate; - difficulty.CircleSize = CircleSize != null ? CircleSize.Value : difficulty.CircleSize; - difficulty.ApproachRate = ApproachRate != null ? ApproachRate.Value : difficulty.ApproachRate; - difficulty.OverallDifficulty = OverallDifficulty != null ? OverallDifficulty.Value : difficulty.OverallDifficulty; + difficulty.DrainRate = DrainRate.Value; + difficulty.CircleSize = CircleSize.Value; + difficulty.ApproachRate = ApproachRate.Value; + difficulty.OverallDifficulty = OverallDifficulty.Value; } } } From ababe7b6c995b2943ad71ce23d9734a62b412bcc Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 13 Dec 2019 15:22:07 +0800 Subject: [PATCH 06/15] refactor mod to make use of #7175 --- osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs b/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs index 532da8a647..f65340e90c 100644 --- a/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs +++ b/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs @@ -65,12 +65,24 @@ namespace osu.Game.Rulesets.Mods Precision = 0.1F, }; + private BeatmapDifficulty difficulty; + public virtual void ApplyToDifficulty(BeatmapDifficulty difficulty) { - difficulty.DrainRate = DrainRate.Value; - difficulty.CircleSize = CircleSize.Value; - difficulty.ApproachRate = ApproachRate.Value; - difficulty.OverallDifficulty = OverallDifficulty.Value; + if (this.difficulty == null || this.difficulty.ID != difficulty.ID) + { + this.difficulty = difficulty; + DrainRate.Value = DrainRate.Default = difficulty.DrainRate; + CircleSize.Value = CircleSize.Default = difficulty.CircleSize; + ApproachRate.Value = ApproachRate.Default = difficulty.ApproachRate; + OverallDifficulty.Value = OverallDifficulty.Default = difficulty.OverallDifficulty; + } else + { + difficulty.DrainRate = DrainRate.Value; + difficulty.CircleSize = CircleSize.Value; + difficulty.ApproachRate = ApproachRate.Value; + difficulty.OverallDifficulty = OverallDifficulty.Value; + } } } } From 0311cc83ad1387d2191d104fab1617a5b4db347a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 13 Dec 2019 15:27:34 +0800 Subject: [PATCH 07/15] add whitespace --- osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs b/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs index f65340e90c..f6216df2b5 100644 --- a/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs +++ b/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs @@ -76,7 +76,8 @@ namespace osu.Game.Rulesets.Mods CircleSize.Value = CircleSize.Default = difficulty.CircleSize; ApproachRate.Value = ApproachRate.Default = difficulty.ApproachRate; OverallDifficulty.Value = OverallDifficulty.Default = difficulty.OverallDifficulty; - } else + } + else { difficulty.DrainRate = DrainRate.Value; difficulty.CircleSize = CircleSize.Value; From ab5aa8594de8cf994834014885ae28818827030f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 13 Dec 2019 15:46:58 +0800 Subject: [PATCH 08/15] remove whitespace --- osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs b/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs index f6216df2b5..b23297345b 100644 --- a/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs +++ b/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs @@ -76,7 +76,7 @@ namespace osu.Game.Rulesets.Mods CircleSize.Value = CircleSize.Default = difficulty.CircleSize; ApproachRate.Value = ApproachRate.Default = difficulty.ApproachRate; OverallDifficulty.Value = OverallDifficulty.Default = difficulty.OverallDifficulty; - } + } else { difficulty.DrainRate = DrainRate.Value; From 08b477ed5248211d9f501258b33b906a8efa7c7b Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 20 Dec 2019 18:30:23 +0800 Subject: [PATCH 09/15] make ModDifficultyAdjust abstract --- osu.Game.Rulesets.Catch/CatchRuleset.cs | 2 +- .../Mods/CatchModDifficultyAdjust.cs | 52 ++++++++++++++ osu.Game.Rulesets.Mania/ManiaRuleset.cs | 2 +- .../Mods/ManiaModDifficultyAdjust.cs | 32 +++++++++ .../Mods/OsuModDifficultyAdjust.cs | 52 ++++++++++++++ osu.Game.Rulesets.Osu/OsuRuleset.cs | 2 +- .../Mods/TaikoModDifficultyAdjust.cs | 32 +++++++++ osu.Game.Rulesets.Taiko/TaikoRuleset.cs | 2 +- osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs | 67 ++++++------------- 9 files changed, 193 insertions(+), 50 deletions(-) create mode 100644 osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs create mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModDifficultyAdjust.cs create mode 100644 osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs create mode 100644 osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index 8f946343a7..4228b86795 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -109,7 +109,7 @@ namespace osu.Game.Rulesets.Catch case ModType.Conversion: return new Mod[] { - new ModDifficultyAdjust(), + new CatchModDifficultyAdjust(), }; case ModType.Automation: diff --git a/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs b/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs new file mode 100644 index 0000000000..127b6c1c0b --- /dev/null +++ b/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs @@ -0,0 +1,52 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Bindables; +using osu.Game.Configuration; +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Catch.Mods +{ + public class CatchModDifficultyAdjust : ModDifficultyAdjust + { + [SettingSource("Drain Rate", "Override a beatmap's set HP.")] + public override BindableNumber DrainRate { get; } = new BindableFloat() + { + Precision = 0.1f, + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + }; + + [SettingSource("Fruit Size", "Override a beatmap's set CS.")] + public override BindableNumber CircleSize { get; } = new BindableFloat() + { + Precision = 0.1f, + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + }; + + [SettingSource("Approach Rate", "Override a beatmap's set AR.")] + public override BindableNumber ApproachRate { get; } = new BindableFloat() + { + Precision = 0.1f, + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + }; + + [SettingSource("Overall Difficulty", "Override a beatmap's set OD.")] + public override BindableNumber OverallDifficulty { get; } = new BindableFloat() + { + Precision = 0.1f, + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + }; + } +} diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index ea64dfaffa..9ab588c550 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -151,7 +151,7 @@ namespace osu.Game.Rulesets.Mania new ManiaModRandom(), new ManiaModDualStages(), new ManiaModMirror(), - new ModDifficultyAdjust(), + new ManiaModDifficultyAdjust(), }; case ModType.Automation: diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModDifficultyAdjust.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModDifficultyAdjust.cs new file mode 100644 index 0000000000..fd1315523c --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModDifficultyAdjust.cs @@ -0,0 +1,32 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Bindables; +using osu.Game.Configuration; +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Mania.Mods +{ + public class ManiaModDifficultyAdjust : ModDifficultyAdjust + { + [SettingSource("Drain Rate", "Override a beatmap's set HP.")] + public override BindableNumber DrainRate { get; } = new BindableFloat() + { + Precision = 0.1f, + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + }; + + [SettingSource("Overall Difficulty", "Override a beatmap's set OD.")] + public override BindableNumber OverallDifficulty { get; } = new BindableFloat() + { + Precision = 0.1f, + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + }; + } +} diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs b/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs new file mode 100644 index 0000000000..3531e002b8 --- /dev/null +++ b/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs @@ -0,0 +1,52 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Bindables; +using osu.Game.Configuration; +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Osu.Mods +{ + public class OsuModDifficultyAdjust : ModDifficultyAdjust + { + [SettingSource("Drain Rate", "Override a beatmap's set HP.")] + public override BindableNumber DrainRate { get; } = new BindableFloat() + { + Precision = 0.1f, + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + }; + + [SettingSource("Circle Size", "Override a beatmap's set CS.")] + public override BindableNumber CircleSize { get; } = new BindableFloat() + { + Precision = 0.1f, + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + }; + + [SettingSource("Approach Rate", "Override a beatmap's set AR.")] + public override BindableNumber ApproachRate { get; } = new BindableFloat() + { + Precision = 0.1f, + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + }; + + [SettingSource("Overall Difficulty", "Override a beatmap's set OD.")] + public override BindableNumber OverallDifficulty { get; } = new BindableFloat() + { + Precision = 0.1f, + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + }; + } +} \ No newline at end of file diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index d097235839..a42402151f 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -130,7 +130,7 @@ namespace osu.Game.Rulesets.Osu return new Mod[] { new OsuModTarget(), - new ModDifficultyAdjust(), + new OsuModDifficultyAdjust(), }; case ModType.Automation: diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs new file mode 100644 index 0000000000..b7007eedcd --- /dev/null +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs @@ -0,0 +1,32 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Bindables; +using osu.Game.Configuration; +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Taiko.Mods +{ + public class TaikoModDifficultyAdjust : ModDifficultyAdjust + { + [SettingSource("Drain Rate", "Override a beatmap's set HP.")] + public override BindableNumber DrainRate { get; } = new BindableFloat() + { + Precision = 0.1f, + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + }; + + [SettingSource("Overall Difficulty", "Override a beatmap's set OD.")] + public override BindableNumber OverallDifficulty { get; } = new BindableFloat() + { + Precision = 0.1f, + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + }; + } +} diff --git a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs index 29b74fc4e0..a055c29efe 100644 --- a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs @@ -108,7 +108,7 @@ namespace osu.Game.Rulesets.Taiko case ModType.Conversion: return new Mod[] { - new ModDifficultyAdjust(), + new TaikoModDifficultyAdjust(), }; case ModType.Automation: diff --git a/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs b/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs index b23297345b..625749903a 100644 --- a/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs +++ b/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs @@ -5,11 +5,10 @@ using osu.Game.Beatmaps; using osu.Framework.Bindables; using osu.Framework.Graphics.Sprites; using System; -using osu.Game.Configuration; namespace osu.Game.Rulesets.Mods { - public class ModDifficultyAdjust : Mod, IApplicableToDifficulty + public abstract class ModDifficultyAdjust : Mod, IApplicableToDifficulty { public override string Name => @"Difficulty Adjust"; @@ -25,45 +24,13 @@ namespace osu.Game.Rulesets.Mods public override Type[] IncompatibleMods => new[] { typeof(ModEasy), typeof(ModHardRock) }; - [SettingSource("Drain Rate", "Override the beatmap's set HP")] - public BindableNumber DrainRate { get; } = new BindableFloat - { - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - Precision = 0.1F, - }; + public virtual BindableNumber DrainRate { get; } - [SettingSource("Circle Size", "Override the beatmap's set CS")] - public BindableNumber CircleSize { get; } = new BindableFloat - { - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - Precision = 0.1F, - }; + public virtual BindableNumber CircleSize { get; } - [SettingSource("Approach Rate", "Override the beatmap's set AR")] - public BindableNumber ApproachRate { get; } = new BindableFloat - { - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - Precision = 0.1F, - }; + public virtual BindableNumber ApproachRate { get; } - [SettingSource("Overall Difficulty", "Override the beatmap's set OD")] - public BindableNumber OverallDifficulty { get; } = new BindableFloat - { - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - Precision = 0.1F, - }; + public virtual BindableNumber OverallDifficulty { get; } private BeatmapDifficulty difficulty; @@ -72,17 +39,25 @@ namespace osu.Game.Rulesets.Mods if (this.difficulty == null || this.difficulty.ID != difficulty.ID) { this.difficulty = difficulty; - DrainRate.Value = DrainRate.Default = difficulty.DrainRate; - CircleSize.Value = CircleSize.Default = difficulty.CircleSize; - ApproachRate.Value = ApproachRate.Default = difficulty.ApproachRate; - OverallDifficulty.Value = OverallDifficulty.Default = difficulty.OverallDifficulty; + + if (DrainRate != null) + DrainRate.Value = DrainRate.Default = difficulty.DrainRate; + + if (CircleSize != null) + CircleSize.Value = CircleSize.Default = difficulty.CircleSize; + + if (ApproachRate != null) + ApproachRate.Value = ApproachRate.Default = difficulty.ApproachRate; + + if (OverallDifficulty != null) + OverallDifficulty.Value = OverallDifficulty.Default = difficulty.OverallDifficulty; } else { - difficulty.DrainRate = DrainRate.Value; - difficulty.CircleSize = CircleSize.Value; - difficulty.ApproachRate = ApproachRate.Value; - difficulty.OverallDifficulty = OverallDifficulty.Value; + difficulty.DrainRate = DrainRate?.Value ?? difficulty.DrainRate; + difficulty.CircleSize = CircleSize?.Value ?? difficulty.CircleSize; + difficulty.ApproachRate = ApproachRate?.Value ?? difficulty.ApproachRate; + difficulty.OverallDifficulty = OverallDifficulty?.Value ?? difficulty.OverallDifficulty; } } } From 1bd44529dd31302a62a55d424135c316233d5384 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 20 Dec 2019 18:31:16 +0800 Subject: [PATCH 10/15] add full-stop to mod description for consistency --- osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs b/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs index 625749903a..546533709e 100644 --- a/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs +++ b/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs @@ -12,7 +12,7 @@ namespace osu.Game.Rulesets.Mods { public override string Name => @"Difficulty Adjust"; - public override string Description => @"Override a beatmap's difficulty settings"; + public override string Description => @"Override a beatmap's difficulty settings."; public override string Acronym => "DA"; From 0eef21894561c17718fc641d94db16a193fabd03 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 20 Dec 2019 18:42:29 +0800 Subject: [PATCH 11/15] add missing new line --- osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs b/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs index 3531e002b8..4847ddc3c4 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs @@ -49,4 +49,4 @@ namespace osu.Game.Rulesets.Osu.Mods Value = 5, }; } -} \ No newline at end of file +} From fe73b9f8d3919a0a983965f5db17569b4f2bd83d Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 22 Dec 2019 16:45:32 +0800 Subject: [PATCH 12/15] make HP and OD generic and instantiate CS and AR to modes that need it --- .../Mods/CatchModDifficultyAdjust.cs | 37 ++++++------ .../Mods/ManiaModDifficultyAdjust.cs | 19 ------ .../Mods/OsuModDifficultyAdjust.cs | 37 ++++++------ .../Mods/TaikoModDifficultyAdjust.cs | 19 ------ osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs | 59 +++++++++++-------- 5 files changed, 68 insertions(+), 103 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs b/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs index 127b6c1c0b..2e1e655844 100644 --- a/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs +++ b/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs @@ -2,6 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using osu.Framework.Bindables; +using osu.Game.Beatmaps; using osu.Game.Configuration; using osu.Game.Rulesets.Mods; @@ -9,18 +10,8 @@ namespace osu.Game.Rulesets.Catch.Mods { public class CatchModDifficultyAdjust : ModDifficultyAdjust { - [SettingSource("Drain Rate", "Override a beatmap's set HP.")] - public override BindableNumber DrainRate { get; } = new BindableFloat() - { - Precision = 0.1f, - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - }; - [SettingSource("Fruit Size", "Override a beatmap's set CS.")] - public override BindableNumber CircleSize { get; } = new BindableFloat() + public BindableNumber CircleSize { get; } = new BindableFloat() { Precision = 0.1f, MinValue = 1, @@ -30,7 +21,7 @@ namespace osu.Game.Rulesets.Catch.Mods }; [SettingSource("Approach Rate", "Override a beatmap's set AR.")] - public override BindableNumber ApproachRate { get; } = new BindableFloat() + public BindableNumber ApproachRate { get; } = new BindableFloat() { Precision = 0.1f, MinValue = 1, @@ -39,14 +30,20 @@ namespace osu.Game.Rulesets.Catch.Mods Value = 5, }; - [SettingSource("Overall Difficulty", "Override a beatmap's set OD.")] - public override BindableNumber OverallDifficulty { get; } = new BindableFloat() + protected override void UpdateSettings(BeatmapDifficulty difficulty) { - Precision = 0.1f, - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - }; + base.UpdateSettings(difficulty); + + CircleSize.Value = CircleSize.Default = difficulty.CircleSize; + ApproachRate.Value = ApproachRate.Default = difficulty.ApproachRate; + } + + protected override void ApplySettings(BeatmapDifficulty difficulty) + { + base.ApplySettings(difficulty); + + difficulty.CircleSize = CircleSize.Value; + difficulty.ApproachRate = ApproachRate.Value; + } } } diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModDifficultyAdjust.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModDifficultyAdjust.cs index fd1315523c..5920e0c3b8 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModDifficultyAdjust.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModDifficultyAdjust.cs @@ -9,24 +9,5 @@ namespace osu.Game.Rulesets.Mania.Mods { public class ManiaModDifficultyAdjust : ModDifficultyAdjust { - [SettingSource("Drain Rate", "Override a beatmap's set HP.")] - public override BindableNumber DrainRate { get; } = new BindableFloat() - { - Precision = 0.1f, - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - }; - - [SettingSource("Overall Difficulty", "Override a beatmap's set OD.")] - public override BindableNumber OverallDifficulty { get; } = new BindableFloat() - { - Precision = 0.1f, - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - }; } } diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs b/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs index 4847ddc3c4..3e9c51db85 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs @@ -2,6 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using osu.Framework.Bindables; +using osu.Game.Beatmaps; using osu.Game.Configuration; using osu.Game.Rulesets.Mods; @@ -9,18 +10,8 @@ namespace osu.Game.Rulesets.Osu.Mods { public class OsuModDifficultyAdjust : ModDifficultyAdjust { - [SettingSource("Drain Rate", "Override a beatmap's set HP.")] - public override BindableNumber DrainRate { get; } = new BindableFloat() - { - Precision = 0.1f, - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - }; - [SettingSource("Circle Size", "Override a beatmap's set CS.")] - public override BindableNumber CircleSize { get; } = new BindableFloat() + public BindableNumber CircleSize { get; } = new BindableFloat() { Precision = 0.1f, MinValue = 1, @@ -30,7 +21,7 @@ namespace osu.Game.Rulesets.Osu.Mods }; [SettingSource("Approach Rate", "Override a beatmap's set AR.")] - public override BindableNumber ApproachRate { get; } = new BindableFloat() + public BindableNumber ApproachRate { get; } = new BindableFloat() { Precision = 0.1f, MinValue = 1, @@ -39,14 +30,20 @@ namespace osu.Game.Rulesets.Osu.Mods Value = 5, }; - [SettingSource("Overall Difficulty", "Override a beatmap's set OD.")] - public override BindableNumber OverallDifficulty { get; } = new BindableFloat() + protected override void UpdateSettings(BeatmapDifficulty difficulty) { - Precision = 0.1f, - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - }; + base.UpdateSettings(difficulty); + + CircleSize.Value = CircleSize.Default = difficulty.CircleSize; + ApproachRate.Value = ApproachRate.Default = difficulty.ApproachRate; + } + + protected override void ApplySettings(BeatmapDifficulty difficulty) + { + base.ApplySettings(difficulty); + + difficulty.CircleSize = CircleSize.Value; + difficulty.ApproachRate = ApproachRate.Value; + } } } diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs index b7007eedcd..3c4812f922 100644 --- a/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs @@ -9,24 +9,5 @@ namespace osu.Game.Rulesets.Taiko.Mods { public class TaikoModDifficultyAdjust : ModDifficultyAdjust { - [SettingSource("Drain Rate", "Override a beatmap's set HP.")] - public override BindableNumber DrainRate { get; } = new BindableFloat() - { - Precision = 0.1f, - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - }; - - [SettingSource("Overall Difficulty", "Override a beatmap's set OD.")] - public override BindableNumber OverallDifficulty { get; } = new BindableFloat() - { - Precision = 0.1f, - MinValue = 1, - MaxValue = 10, - Default = 5, - Value = 5, - }; } } diff --git a/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs b/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs index 546533709e..1405ccec8d 100644 --- a/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs +++ b/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs @@ -5,6 +5,7 @@ using osu.Game.Beatmaps; using osu.Framework.Bindables; using osu.Framework.Graphics.Sprites; using System; +using osu.Game.Configuration; namespace osu.Game.Rulesets.Mods { @@ -24,41 +25,49 @@ namespace osu.Game.Rulesets.Mods public override Type[] IncompatibleMods => new[] { typeof(ModEasy), typeof(ModHardRock) }; - public virtual BindableNumber DrainRate { get; } + [SettingSource("Drain Rate", "Override a beatmap's set HP.")] + public BindableNumber DrainRate { get; } = new BindableFloat() + { + Precision = 0.1f, + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + }; - public virtual BindableNumber CircleSize { get; } - - public virtual BindableNumber ApproachRate { get; } - - public virtual BindableNumber OverallDifficulty { get; } + [SettingSource("Overall Difficulty", "Override a beatmap's set OD.")] + public BindableNumber OverallDifficulty { get; } = new BindableFloat() + { + Precision = 0.1f, + MinValue = 1, + MaxValue = 10, + Default = 5, + Value = 5, + }; private BeatmapDifficulty difficulty; - public virtual void ApplyToDifficulty(BeatmapDifficulty difficulty) + public void ApplyToDifficulty(BeatmapDifficulty difficulty) { if (this.difficulty == null || this.difficulty.ID != difficulty.ID) { this.difficulty = difficulty; - - if (DrainRate != null) - DrainRate.Value = DrainRate.Default = difficulty.DrainRate; - - if (CircleSize != null) - CircleSize.Value = CircleSize.Default = difficulty.CircleSize; - - if (ApproachRate != null) - ApproachRate.Value = ApproachRate.Default = difficulty.ApproachRate; - - if (OverallDifficulty != null) - OverallDifficulty.Value = OverallDifficulty.Default = difficulty.OverallDifficulty; + UpdateSettings(difficulty); } else - { - difficulty.DrainRate = DrainRate?.Value ?? difficulty.DrainRate; - difficulty.CircleSize = CircleSize?.Value ?? difficulty.CircleSize; - difficulty.ApproachRate = ApproachRate?.Value ?? difficulty.ApproachRate; - difficulty.OverallDifficulty = OverallDifficulty?.Value ?? difficulty.OverallDifficulty; - } + ApplySettings(difficulty); + } + + protected virtual void UpdateSettings(BeatmapDifficulty difficulty) + { + DrainRate.Value = DrainRate.Default = difficulty.DrainRate; + OverallDifficulty.Value = OverallDifficulty.Default = difficulty.OverallDifficulty; + } + + protected virtual void ApplySettings(BeatmapDifficulty difficulty) + { + difficulty.DrainRate = DrainRate.Value; + difficulty.OverallDifficulty = OverallDifficulty.Value; } } } From 00ef2bd8d37c1b226ed39429ca0044723ebb3199 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 22 Dec 2019 16:57:07 +0800 Subject: [PATCH 13/15] remove unused usings --- osu.Game.Rulesets.Mania/Mods/ManiaModDifficultyAdjust.cs | 2 -- osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs | 2 -- 2 files changed, 4 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModDifficultyAdjust.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModDifficultyAdjust.cs index 5920e0c3b8..0817f8f9fc 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModDifficultyAdjust.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModDifficultyAdjust.cs @@ -1,8 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using osu.Framework.Bindables; -using osu.Game.Configuration; using osu.Game.Rulesets.Mods; namespace osu.Game.Rulesets.Mania.Mods diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs index 3c4812f922..56a73ad7df 100644 --- a/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs @@ -1,8 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using osu.Framework.Bindables; -using osu.Game.Configuration; using osu.Game.Rulesets.Mods; namespace osu.Game.Rulesets.Taiko.Mods From 52ba0cd816381fe5a1208c7aba8266caa0f839b9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 25 Dec 2019 15:20:04 +0900 Subject: [PATCH 14/15] Rename method to be more appropriate Also adds xmldoc. --- .../Mods/CatchModDifficultyAdjust.cs | 4 ++-- osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs | 4 ++-- osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs | 12 ++++++++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs b/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs index 2e1e655844..a3e314eee8 100644 --- a/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs +++ b/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs @@ -30,9 +30,9 @@ namespace osu.Game.Rulesets.Catch.Mods Value = 5, }; - protected override void UpdateSettings(BeatmapDifficulty difficulty) + protected override void TransferSettings(BeatmapDifficulty difficulty) { - base.UpdateSettings(difficulty); + base.TransferSettings(difficulty); CircleSize.Value = CircleSize.Default = difficulty.CircleSize; ApproachRate.Value = ApproachRate.Default = difficulty.ApproachRate; diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs b/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs index 3e9c51db85..6c76de5440 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs @@ -30,9 +30,9 @@ namespace osu.Game.Rulesets.Osu.Mods Value = 5, }; - protected override void UpdateSettings(BeatmapDifficulty difficulty) + protected override void TransferSettings(BeatmapDifficulty difficulty) { - base.UpdateSettings(difficulty); + base.TransferSettings(difficulty); CircleSize.Value = CircleSize.Default = difficulty.CircleSize; ApproachRate.Value = ApproachRate.Default = difficulty.ApproachRate; diff --git a/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs b/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs index 1405ccec8d..9721784aee 100644 --- a/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs +++ b/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs @@ -52,18 +52,26 @@ namespace osu.Game.Rulesets.Mods if (this.difficulty == null || this.difficulty.ID != difficulty.ID) { this.difficulty = difficulty; - UpdateSettings(difficulty); + TransferSettings(difficulty); } else ApplySettings(difficulty); } - protected virtual void UpdateSettings(BeatmapDifficulty difficulty) + /// + /// Transfer initial settings from the beatmap to settings. + /// + /// The beatmap's initial values. + protected virtual void TransferSettings(BeatmapDifficulty difficulty) { DrainRate.Value = DrainRate.Default = difficulty.DrainRate; OverallDifficulty.Value = OverallDifficulty.Default = difficulty.OverallDifficulty; } + /// + /// Apply all custom settings to the provided beatmap. + /// + /// The beatmap to have settings applied. protected virtual void ApplySettings(BeatmapDifficulty difficulty) { difficulty.DrainRate = DrainRate.Value; From 911dc2d98dfe1074feeba9d9b83dd2ebaa9a02ce Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 25 Dec 2019 15:20:10 +0900 Subject: [PATCH 15/15] Fix code inspections --- osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs | 4 ++-- osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs | 4 ++-- osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs b/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs index a3e314eee8..4c0f5d510e 100644 --- a/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs +++ b/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs @@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Catch.Mods public class CatchModDifficultyAdjust : ModDifficultyAdjust { [SettingSource("Fruit Size", "Override a beatmap's set CS.")] - public BindableNumber CircleSize { get; } = new BindableFloat() + public BindableNumber CircleSize { get; } = new BindableFloat { Precision = 0.1f, MinValue = 1, @@ -21,7 +21,7 @@ namespace osu.Game.Rulesets.Catch.Mods }; [SettingSource("Approach Rate", "Override a beatmap's set AR.")] - public BindableNumber ApproachRate { get; } = new BindableFloat() + public BindableNumber ApproachRate { get; } = new BindableFloat { Precision = 0.1f, MinValue = 1, diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs b/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs index 6c76de5440..0514e2ab34 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs @@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Osu.Mods public class OsuModDifficultyAdjust : ModDifficultyAdjust { [SettingSource("Circle Size", "Override a beatmap's set CS.")] - public BindableNumber CircleSize { get; } = new BindableFloat() + public BindableNumber CircleSize { get; } = new BindableFloat { Precision = 0.1f, MinValue = 1, @@ -21,7 +21,7 @@ namespace osu.Game.Rulesets.Osu.Mods }; [SettingSource("Approach Rate", "Override a beatmap's set AR.")] - public BindableNumber ApproachRate { get; } = new BindableFloat() + public BindableNumber ApproachRate { get; } = new BindableFloat { Precision = 0.1f, MinValue = 1, diff --git a/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs b/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs index 9721784aee..224fc78508 100644 --- a/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs +++ b/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs @@ -26,7 +26,7 @@ namespace osu.Game.Rulesets.Mods public override Type[] IncompatibleMods => new[] { typeof(ModEasy), typeof(ModHardRock) }; [SettingSource("Drain Rate", "Override a beatmap's set HP.")] - public BindableNumber DrainRate { get; } = new BindableFloat() + public BindableNumber DrainRate { get; } = new BindableFloat { Precision = 0.1f, MinValue = 1, @@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.Mods }; [SettingSource("Overall Difficulty", "Override a beatmap's set OD.")] - public BindableNumber OverallDifficulty { get; } = new BindableFloat() + public BindableNumber OverallDifficulty { get; } = new BindableFloat { Precision = 0.1f, MinValue = 1,