From d1c72f5e133cad392580c9dcd80f8fe2c9987816 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 16 Apr 2021 15:10:53 +0900 Subject: [PATCH 1/3] Apply changes resulting from IBindable interface updates --- osu.Game/Rulesets/Mods/Mod.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Mods/Mod.cs b/osu.Game/Rulesets/Mods/Mod.cs index 4879590e24..eab886c86e 100644 --- a/osu.Game/Rulesets/Mods/Mod.cs +++ b/osu.Game/Rulesets/Mods/Mod.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Reflection; using Newtonsoft.Json; using osu.Framework.Bindables; +using osu.Framework.Extensions.TypeExtensions; using osu.Framework.Graphics.Sprites; using osu.Framework.Testing; using osu.Game.Configuration; @@ -170,7 +171,12 @@ namespace osu.Game.Rulesets.Mods target.UnbindFrom(sourceBindable); } else - target.Parse(source); + { + if (!(target is IParseable parseable)) + throw new InvalidOperationException($"Bindable type {target.GetType().ReadableName()} is not IParseable."); + + parseable.Parse(source); + } } public bool Equals(IMod other) => other is Mod them && Equals(them); From 8c4804dd7a63e69540dcb22c1e800d9dc9917d39 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 16 Apr 2021 15:40:06 +0900 Subject: [PATCH 2/3] Use nameof --- osu.Game/Rulesets/Mods/Mod.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Mods/Mod.cs b/osu.Game/Rulesets/Mods/Mod.cs index eab886c86e..7f48888abe 100644 --- a/osu.Game/Rulesets/Mods/Mod.cs +++ b/osu.Game/Rulesets/Mods/Mod.cs @@ -173,7 +173,7 @@ namespace osu.Game.Rulesets.Mods else { if (!(target is IParseable parseable)) - throw new InvalidOperationException($"Bindable type {target.GetType().ReadableName()} is not IParseable."); + throw new InvalidOperationException($"Bindable type {target.GetType().ReadableName()} is not {nameof(IParseable)}."); parseable.Parse(source); } From fbf7d838da12f3a2b6d0c576b64558ec30a114d6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 16 Apr 2021 17:30:39 +0900 Subject: [PATCH 3/3] Update framework --- osu.Android.props | 2 +- osu.Game/osu.Game.csproj | 2 +- osu.iOS.props | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Android.props b/osu.Android.props index 32e236ccd5..0bb0bf171c 100644 --- a/osu.Android.props +++ b/osu.Android.props @@ -52,6 +52,6 @@ - + diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index b5405f6262..e0a267241d 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -29,7 +29,7 @@ - + diff --git a/osu.iOS.props b/osu.iOS.props index 09f6033bfe..bcd953c0bd 100644 --- a/osu.iOS.props +++ b/osu.iOS.props @@ -70,7 +70,7 @@ - + @@ -93,7 +93,7 @@ - +