From b9a40a841b7311673c517f5f1b11bb4bd53d7a8d Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Sat, 13 May 2017 21:28:53 +0800 Subject: [PATCH] Use IsAssignableFrom. --- osu.Game/Graphics/UserInterface/RollingCounter.cs | 2 +- osu.Game/Overlays/NotificationManager.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/RollingCounter.cs b/osu.Game/Graphics/UserInterface/RollingCounter.cs index e98867277a..bdb2054ca4 100644 --- a/osu.Game/Graphics/UserInterface/RollingCounter.cs +++ b/osu.Game/Graphics/UserInterface/RollingCounter.cs @@ -181,7 +181,7 @@ namespace osu.Game.Graphics.UserInterface protected virtual void TransformCount(T currentValue, T newValue) { Debug.Assert( - TransformType.IsSubclassOf(typeof(Transform)) || TransformType == typeof(Transform), + typeof(Transform).IsAssignableFrom(TransformType), @"transformType should be a subclass of Transform." ); diff --git a/osu.Game/Overlays/NotificationManager.cs b/osu.Game/Overlays/NotificationManager.cs index b344d533ee..3ddd85cfcf 100644 --- a/osu.Game/Overlays/NotificationManager.cs +++ b/osu.Game/Overlays/NotificationManager.cs @@ -81,7 +81,7 @@ namespace osu.Game.Overlays hasCompletionTarget.CompletionTarget = Post; var ourType = notification.GetType(); - sections.Children.FirstOrDefault(s => s.AcceptTypes.Any(accept => ourType == accept || ourType.IsSubclassOf(accept)))?.Add(notification); + sections.Children.FirstOrDefault(s => s.AcceptTypes.Any(accept => accept.IsAssignableFrom(ourType)))?.Add(notification); } protected override void PopIn()