using Nonemm.Core; using Nonemm.Core.Country; namespace Nonemm.Contests; /// A QSO together with what the country file says about it, so a contest can /// score by country, zone or continent without looking anything up itself. public sealed record QsoContext(Qso Qso, CountryLookup? Country, StationInfo Me) { public Band? Band => Qso.Band; public ModeCategory ModeCategory => Qso.Mode.Category; public string Continent => Country?.Continent ?? Qso.Continent; public string CountryPrefix => Country?.Entity.PrimaryPrefix ?? Qso.CountryPrefix; public int CqZone => Country?.CqZone ?? Qso.Zone; public int ItuZone => Country?.ItuZone ?? 0; public bool IsSameCountry => CountryPrefix.Length > 0 && CountryPrefix == Me.CountryPrefix; public bool IsSameContinent => Continent.Length > 0 && Continent == Me.Continent; }