mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 12:53:11 +08:00
Use IsAssignableFrom.
This commit is contained in:
parent
8b6d0864f0
commit
b9a40a841b
@ -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>."
|
||||
);
|
||||
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user