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 JARL All Asian DX contest. Only contacts with Asia count for a station
|
||||
/// outside it. The exchange is the operator's age, the points go by band, and
|
||||
/// each prefix worked counts once per band.
|
||||
public sealed class AllAsian : Contest
|
||||
{
|
||||
private readonly ModeCategory mode;
|
||||
|
||||
public AllAsian(ModeCategory mode) => this.mode = mode;
|
||||
|
||||
public string Name => mode == ModeCategory.Cw ? "ALLASIACW" : "ALLASIASSB";
|
||||
|
||||
public string DisplayName => $"All Asian DX {ModeLabel()}";
|
||||
|
||||
public string CabrilloName => mode == ModeCategory.Cw ? "AA-CW" : "AA-SSB";
|
||||
|
||||
public IReadOnlyList<ExchangeField> ExchangeFieldsFor(StationInfo me) =>
|
||||
[
|
||||
new ExchangeField("RST", ExchangeSlot.ReceivedReport, ExchangeFieldKind.Report),
|
||||
new ExchangeField("Age", ExchangeSlot.Exchange1, ExchangeFieldKind.Number) { Width = 3 },
|
||||
];
|
||||
|
||||
public IReadOnlyList<string> MultiplierNames => ["Prefixes"];
|
||||
|
||||
public DupeScope DupeScope => DupeScope.PerBand;
|
||||
|
||||
public bool HasSerialNumbers => false;
|
||||
|
||||
public IReadOnlyList<ModeCategory> Modes => [mode];
|
||||
|
||||
public string SentExchangeFor(StationInfo me) => "";
|
||||
|
||||
public int PointsFor(QsoContext qso) => IsWorkable(qso) ? PointsOn(qso.Band) : 0;
|
||||
|
||||
public IReadOnlyList<Multiplier> MultipliersFor(QsoContext qso) =>
|
||||
IsWorkable(qso) && qso.Qso.Call.WpxPrefix() is { } prefix
|
||||
? [new Multiplier(1, prefix, 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(entry.SentExchange, 3),
|
||||
],
|
||||
[
|
||||
new CabrilloField(qso.Call.Text, 13),
|
||||
new CabrilloField(qso.ReceivedReport, 3),
|
||||
new CabrilloField(qso.Exchange1, 3),
|
||||
]);
|
||||
|
||||
/// One side of every contact has to be in Asia.
|
||||
private static bool IsWorkable(QsoContext qso) =>
|
||||
qso.Continent == "AS" || qso.Me.Continent == "AS";
|
||||
|
||||
private static int PointsOn(Band? band) => band?.Name switch
|
||||
{
|
||||
"160M" or "80M" => 3,
|
||||
"40M" => 2,
|
||||
null => 0,
|
||||
_ => 1,
|
||||
};
|
||||
|
||||
private string ModeLabel() => mode == ModeCategory.Cw ? "CW" : "SSB";
|
||||
}
|
||||
Reference in New Issue
Block a user