Score All Asian from the entrant's own side

All Asian is two contests in one class and only one of them was written.
An Asian entrant was paid three times the band table for every contact,
including Asian ones, could work its own country, and counted WPX
prefixes where the rules count DXCC entities.

AllAsian now asks where the entrant is. An Asian station works anybody
outside its own country, gets the band table once for Asia and three
times for the rest, and counts entities. Everybody else works Asia only
and counts prefixes, as before.

Maritime mobiles follow the JARL rule rather than N1MM, which applies it
to non-Asian entrants alone: a station at sea makes a valid contact with
Asian stations only, is paid the Asian rate wherever it is, and counts
for no multiplier either way.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0157i7PiZyqBkquxS9A6FTdQ
This commit is contained in:
2026-09-10 20:43:43 +00:00
co-authored by Claude Opus 5
parent 04b6f14639
commit f5e3d9ed8a
11 changed files with 733 additions and 12 deletions
+29 -12
View File
@@ -2,10 +2,11 @@ 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. An Asian station scores three
/// times what a station outside Asia scores for the same contact.
/// The JARL All Asian DX contest. It is two contests in one. A station
/// outside Asia works Asia only, and counts the WPX prefix of each Asian
/// station once per band. An Asian station works everybody except its own
/// country, counts countries instead of prefixes, and is paid three times the
/// band value for a contact outside Asia.
public sealed class AllAsian : Contest
{
private readonly ModeCategory mode;
@@ -41,13 +42,23 @@ public sealed class AllAsian : Contest
{
return 0;
}
return PointsOn(qso.Band) * (qso.Me.Continent == "AS" ? 3 : 1);
bool treble = qso.Me.Continent == "AS"
&& qso.Continent != "AS"
&& !qso.Qso.Call.IsMaritimeMobile;
return PointsOn(qso.Band) * (treble ? 3 : 1);
}
public IReadOnlyList<Multiplier> MultipliersFor(QsoContext qso) =>
IsWorkable(qso) && qso.Qso.Call.WpxPrefix() is { } prefix
? [new Multiplier(1, prefix, qso.Band?.Name ?? "")]
: [];
public IReadOnlyList<Multiplier> MultipliersFor(QsoContext qso)
{
if (!IsWorkable(qso) || qso.Qso.Call.IsMaritimeMobile)
{
return [];
}
string? value = qso.Me.Continent == "AS" ? qso.CountryPrefix : qso.Qso.Call.WpxPrefix();
return string.IsNullOrEmpty(value)
? []
: [new Multiplier(1, value, qso.Band?.Name ?? "")];
}
public int TotalScore(ScoreTally tally, ContestEntry entry) =>
tally.Points * tally.TotalMultipliers;
@@ -65,11 +76,17 @@ public sealed class AllAsian : Contest
new CabrilloField(qso.Exchange1, 3),
]);
/// One side of every contact has to be in Asia.
/// An Asian station works anybody outside its own country. Everybody else
/// works Asia only, and a maritime mobile is not one of them: a station at
/// sea makes a valid contact with an Asian station alone.
public bool IsWorkable(QsoContext qso) =>
qso.Continent == "AS" || qso.Me.Continent == "AS";
qso.Me.Continent == "AS"
? !qso.IsSameCountry
: qso.Continent == "AS" && !qso.Qso.Call.IsMaritimeMobile;
/// 160 metres is worth 3, 80 and 10 metres 2, and every other band 1.
/// 160 metres is worth 3, 80 and 10 metres 2, and every other band 1. An
/// Asian entrant works from the same table and trebles it outside Asia,
/// except for a maritime mobile, which pays the Asian rate wherever it is.
private static int PointsOn(Band? band) => band?.Name switch
{
"160M" => 3,