Add the rest of the major contests, .udc files and the registry

ARRL DX, IARU HF, Sweepstakes, RTTY Roundup, NAQP and general logging join
CQ WW and CQ WPX. The Cabrillo QSO line is now built column by column by the
contest, because Sweepstakes puts the callsign after the serial number where
everyone else puts it first.

User-defined contests read the subset of N1MM's .udc settings that covers the
exchange, the dupe rule, points and up to three multipliers.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Erik
2026-08-27 10:35:28 +00:00
co-authored by Claude Opus 5
parent 0f84bc8972
commit ef631f1dc4
26 changed files with 1162 additions and 13 deletions
+61
View File
@@ -0,0 +1,61 @@
using Nonemm.Contests.Multipliers;
using Nonemm.Core;
namespace Nonemm.Contests.Rules;
/// ARRL RTTY Roundup. One point a contact; states, provinces and DXCC entities
/// each count once for the whole contest.
public sealed class RttyRoundup : Contest
{
public string Name => "ARRLRTTY";
public string DisplayName => "ARRL RTTY Roundup";
public string CabrilloName => "ARRL-RTTY";
public IReadOnlyList<ExchangeField> ExchangeFieldsFor(StationInfo me) =>
[
new ExchangeField("RST", ExchangeSlot.ReceivedReport, ExchangeFieldKind.Report),
new ExchangeField("S/P/Nr", ExchangeSlot.Exchange1, ExchangeFieldKind.Text) { Width = 6 },
];
public IReadOnlyList<string> MultiplierNames => ["Mults"];
public DupeScope DupeScope => DupeScope.PerBand;
public bool HasSerialNumbers => true;
public IReadOnlyList<ModeCategory> Modes => [ModeCategory.Digital];
public string SentExchangeFor(StationInfo me) =>
me.State.Length > 0 ? $"599 {me.State}" : "599";
public int PointsFor(QsoContext qso) => 1;
/// A North American station sends a state or province and counts as that;
/// everyone else counts as their DXCC entity.
public IReadOnlyList<Multiplier> MultipliersFor(QsoContext qso)
{
string exchange = qso.Qso.Exchange1.Trim().ToUpperInvariant();
if (StatesAndProvinces.IsStateOrProvince(exchange))
{
return [new Multiplier(1, exchange, "")];
}
return qso.CountryPrefix.Length == 0 ? [] : [new Multiplier(1, qso.CountryPrefix, "")];
}
public int TotalScore(ScoreTally tally) => tally.Points * tally.TotalMultipliers;
public CabrilloExchange CabrilloExchange(Qso qso, StationInfo me) =>
new(
[
new CabrilloField(me.Callsign, 13),
new CabrilloField(qso.SentReport, 3),
new CabrilloField(me.State.Length > 0 ? me.State : $"{qso.SentNumber}", 6),
],
[
new CabrilloField(qso.Call.Text, 13),
new CabrilloField(qso.ReceivedReport, 3),
new CabrilloField(qso.Exchange1, 6),
]);
}