Add the twelve contests left in the station's log
REF, the Ukrainian DX contest, the BARTG Sprint, ARRL 10M, Russian DX RTTY, RDAC, YO DX HF, Oceania DX, IARU Region 1 Field Day, SARTG RTTY, All Asian and SA 10. Every contest name in the log now opens, and every one of these but Field Day scores its log contact for contact as N1MM did. Most are written from N1MM's own class and checked against the log. Three things the log settled that the class does not say plainly: ARRL 10M counts its multipliers once per mode rather than once, the BARTG Sprint counts a continent once in the contest while its countries and call areas count per band, and RDAC counts nothing but the districts and scores nothing for a station that sends none. All Asian and SA 10 have no class in N1MM, which logs them from a .udc file, so those two are written from the published rules and the log. docs/unfinished.md lists what is still not settled. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RoGtneMQaz4M9w7Kk49AVD
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
using Nonemm.Core;
|
||||
|
||||
namespace Nonemm.Contests.Rules;
|
||||
|
||||
/// The IARU Region 1 Field Day. A portable station is worth 5 points, a station
|
||||
/// in Region 1 operating from home 2, and one outside Region 1 3. The exchange
|
||||
/// is a serial number and the countries are multipliers, once per band.
|
||||
public sealed class FieldDayRegionOne : Contest
|
||||
{
|
||||
public string Name => "FDREG1";
|
||||
|
||||
public string DisplayName => "IARU Region 1 Field Day";
|
||||
|
||||
public string CabrilloName => "FIELDDAY-REGION-1";
|
||||
|
||||
public IReadOnlyList<ExchangeField> ExchangeFieldsFor(StationInfo me) =>
|
||||
[
|
||||
new ExchangeField("RST", ExchangeSlot.ReceivedReport, ExchangeFieldKind.Report),
|
||||
new ExchangeField("Nr", ExchangeSlot.SerialNumber, ExchangeFieldKind.Number),
|
||||
];
|
||||
|
||||
public IReadOnlyList<string> MultiplierNames => ["Countries"];
|
||||
|
||||
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)
|
||||
{
|
||||
if (IsPortable(qso.Qso.Call))
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
return IsRegionOne(qso.Continent) ? 2 : 3;
|
||||
}
|
||||
|
||||
public IReadOnlyList<Multiplier> MultipliersFor(QsoContext qso) =>
|
||||
qso.CountryPrefix.Length == 0
|
||||
? []
|
||||
: [new Multiplier(1, qso.CountryPrefix, qso.Band?.Name ?? "")];
|
||||
|
||||
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(qso.Call.Text, 13),
|
||||
new CabrilloField(qso.ReceivedReport, 3),
|
||||
new CabrilloField($"{qso.ReceivedNumber:000}", 4),
|
||||
]);
|
||||
|
||||
/// A field day station signs portable, mobile or /A.
|
||||
private static bool IsPortable(Callsign call) =>
|
||||
call.Text.EndsWith("/P", StringComparison.OrdinalIgnoreCase)
|
||||
|| call.Text.EndsWith("/M", StringComparison.OrdinalIgnoreCase)
|
||||
|| call.Text.EndsWith("/A", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
/// Region 1 is Europe, Africa and the Middle East; the country file names
|
||||
/// the first two, and Asia is split between regions, which the continent
|
||||
/// alone cannot say.
|
||||
private static bool IsRegionOne(string continent) => continent is "EU" or "AF";
|
||||
}
|
||||
Reference in New Issue
Block a user