using System;
using System.Linq;
using System.Reflection;

namespace MonoGame.FourEngine.Extensions
{
    public static class TypeInfoExt
    {
        public static bool HasAttribute<T>(this TypeInfo type) where T : Attribute
        {
            var attr = typeof(T);
            return type.CustomAttributes.Any(t => t.AttributeType == attr);
        }
    }
}