Apply changes resulting from IBindable interface updates

This commit is contained in:
smoogipoo 2021-04-16 15:10:53 +09:00
parent 1ebd9975f6
commit d1c72f5e13

View File

@ -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);