using System;
using System.Collections.Generic;
using System.Linq;

namespace Quadarax.Foundation.Core.Value.Extensions
{
    public static class EnumExt
    {
        public static IEnumerable<TEnum> All<TEnum>(this TEnum owner) where TEnum : Enum
        {
            return Enum.GetValues(typeof(TEnum)).Cast<TEnum>();
        }

        public static bool In<TEnum>(this TEnum owner, params TEnum[] values) where TEnum : Enum
        {
            return values.Contains(owner);
        }
    }
}
