using ReCodeIt.Enums;
using MoreLinq.Extensions;
namespace ReCodeIt.Utils;
internal static class EnumExtensions
{
///
/// Returns a match from a list of match results
///
///
/// highest EMatchResult
public static EMatchResult GetMatch(this List matches)
{
// Prioritize returning matches
if (matches.Contains(EMatchResult.Match)) { return EMatchResult.Match; }
// Then NoMatches
if (matches.Contains(EMatchResult.NoMatch)) { return EMatchResult.NoMatch; }
// Then Disabled
if (matches.Contains(EMatchResult.Disabled)) { return EMatchResult.Disabled; }
// default to disabled
return EMatchResult.Disabled;
}
}