Add IOTA, the EU DX Contest, CQ 160 and Mexico RTTY

Four more of the contests in the station's log. IOTA, CQ 160 and Mexico RTTY
score every contact in it exactly as N1MM did.

IOTA pays 15 points for a station that sends an island reference and 2 for one
that does not, and counts each reference once per band and mode. CQ 160 is one
band, so its states and countries count once each. Mexico RTTY and CQ 160 both
take a state from one side of the contest and a serial or a zone from the
other, in the columns N1MM keeps them in.

The EU DX Contest is written from N1MM's class, including its list of what
counts as Europe: the European Union, its outermost regions and its overseas
territories, and nothing else. The station's own logs were made with the .udc
file, which scores and counts two things differently; docs/unfinished.md says
which.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RoGtneMQaz4M9w7Kk49AVD
This commit is contained in:
2026-08-31 09:33:29 +00:00
co-authored by Claude Opus 5
parent 3932f83147
commit 7d9bc05e9a
12 changed files with 471 additions and 7 deletions
+69
View File
@@ -0,0 +1,69 @@
using Nonemm.Core;
namespace Nonemm.Contests.Rules;
/// RSGB Islands On The Air. A station on an island sends its IOTA reference
/// after the serial number and is worth 15 points; everyone else is worth 2.
/// Each reference counts once per band and mode.
///
/// The operator's own island is not held anywhere, so the contest cannot yet
/// score a contact with a station on the same island, which N1MM counts as 5
/// points.
public sealed class Iota : Contest
{
public string Name => "IOTA";
public string DisplayName => "RSGB Islands On The Air";
public string CabrilloName => "RSGB-IOTA";
public IReadOnlyList<ExchangeField> ExchangeFieldsFor(StationInfo me) =>
[
new ExchangeField("RST", ExchangeSlot.ReceivedReport, ExchangeFieldKind.Report),
new ExchangeField("Nr", ExchangeSlot.SerialNumber, ExchangeFieldKind.Number),
new ExchangeField("IOTA", ExchangeSlot.Section, ExchangeFieldKind.Text, IsRequired: false)
{
Width = 6,
},
];
public IReadOnlyList<string> MultiplierNames => ["Islands"];
public DupeScope DupeScope => DupeScope.PerBandAndMode;
public bool HasSerialNumbers => true;
public IReadOnlyList<ModeCategory> Modes => [ModeCategory.Cw, ModeCategory.Phone];
public string SentExchangeFor(StationInfo me) => "001";
public int PointsFor(QsoContext qso) => Reference(qso.Qso).Length > 0 ? 15 : 2;
public IReadOnlyList<Multiplier> MultipliersFor(QsoContext qso)
{
string reference = Reference(qso.Qso);
return reference.Length == 0
? []
: [new Multiplier(1, reference, $"{qso.Band?.Name}|{qso.ModeCategory}")];
}
public int TotalScore(ScoreTally tally, ContestEntry entry) =>
tally.Points * tally.TotalMultipliers;
public CabrilloExchange CabrilloExchange(Qso qso, StationInfo me, ContestEntry entry) =>
new(
[
new CabrilloField(me.Callsign, 13),
new CabrilloField(qso.SentReport, 3),
new CabrilloField($"{qso.SentNumber:000}", 4),
new CabrilloField(entry.SentExchange, 6),
],
[
new CabrilloField(qso.Call.Text, 13),
new CabrilloField(qso.ReceivedReport, 3),
new CabrilloField($"{qso.ReceivedNumber:000}", 4),
new CabrilloField(Reference(qso), 6),
]);
private static string Reference(Qso qso) => qso.Section.Trim().ToUpperInvariant();
}