1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 12:53:11 +08:00

Use IsAssignableFrom.

This commit is contained in:
Huo Yaoyuan 2017-05-13 21:28:53 +08:00
parent 8b6d0864f0
commit b9a40a841b
2 changed files with 2 additions and 2 deletions

View File

@ -181,7 +181,7 @@ namespace osu.Game.Graphics.UserInterface
protected virtual void TransformCount(T currentValue, T newValue)
{
Debug.Assert(
TransformType.IsSubclassOf(typeof(Transform<T>)) || TransformType == typeof(Transform<T>),
typeof(Transform<T>).IsAssignableFrom(TransformType),
@"transformType should be a subclass of Transform<T>."
);

View File

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