Add the core, contest, storage and format layers
Frequencies, bands, modes, callsigns, grid squares and the country file live in Nonemm.Core. Nonemm.Contests holds the scoring engine and CQ WW and CQ WPX. Nonemm.Storage writes N1MM's DXLOG schema, and Nonemm.Formats writes Cabrillo 3.0 and reads and writes ADIF. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
25
src/Nonemm.Contests/QsoContext.cs
Normal file
25
src/Nonemm.Contests/QsoContext.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user