using Nonemm.Core; namespace Nonemm.Contests; /// Reading the entry's class off the Cabrillo categories. N1MM reads the /// number of transmitters off the operator category on Cabrillo 2.0 and off /// the transmitter category after it, so both are checked here and an entry /// written either way is read. public static class EntryCategories { public static bool IsMultiOperator(ContestEntry entry) => entry.OperatorCategory.StartsWith("MULTI", StringComparison.OrdinalIgnoreCase); public static bool IsMultiOne(ContestEntry entry) => Is(entry, "MULTI-ONE", "ONE"); public static bool IsMultiTwo(ContestEntry entry) => Is(entry, "MULTI-TWO", "TWO"); public static bool IsMultiMulti(ContestEntry entry) => Is(entry, "MULTI-MULTI", "UNLIMITED"); private static bool Is(ContestEntry entry, string operatorCategory, string transmitterCategory) => IsMultiOperator(entry) && (entry.OperatorCategory.Equals(operatorCategory, StringComparison.OrdinalIgnoreCase) || entry.TransmitterCategory.Equals(transmitterCategory, StringComparison.OrdinalIgnoreCase)); }