Paint a WAE station by the traffic left with it, as N1MM does
N1MM has four colours for a station in WAE rather than the usual three, and the manual and the RTTY tutorial both spell them out. Red is a new multiplier, as everywhere else. Green is a new station with QTC traffic still to exchange, which takes the more-than-one-multiplier colour because WAE has no second multiplier to use it. Black is a station already worked that still has traffic left — worth working for the QTC points alone — and it is a colour of its own, N1MM's "Color of a QTC callsign in the WAE contest". Grey is a dupe with nothing left, the same as in other contests. The verdict carries how much traffic is left with the station, so the callsign box, the check window, the bandmap and everything else that colours a station say the same thing. The contest works the number out: ten with a station on the other side of the contest, none with one on our own continent, and none once the ten have gone. Every other contest answers nought. The log counts the QTC rows per station as they are indexed rather than counting them again for each station judged, because the bandmap judges every spot it holds on every pass. The verdict line says it in words as well, so a dupe reads `dupe · 7 QTCs left` rather than `dupe`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0157i7PiZyqBkquxS9A6FTdQ
This commit is contained in:
@@ -128,6 +128,11 @@ public interface Contest
|
||||
/// bring no multiplier and cannot be a dupe.
|
||||
bool IsContact(Qso qso) => true;
|
||||
|
||||
/// How many more QTC lines may be exchanged with this station, given how
|
||||
/// many have gone already. WAE answers; every other contest has no traffic
|
||||
/// and answers nought.
|
||||
int TrafficLeft(QsoContext qso, int exchanged) => 0;
|
||||
|
||||
/// False for a station this entry may not work at all: the wrong continent
|
||||
/// in WAE, our own callsign, and so on. N1MM marks such a contact `N` in
|
||||
/// the contact type column and gives it no points. Most contests take
|
||||
|
||||
@@ -13,6 +13,11 @@ public sealed class ContestLog
|
||||
private readonly CountryFile? countries;
|
||||
private readonly List<Qso> qsos = [];
|
||||
private readonly Dictionary<string, DateTime> workedKeys = new(StringComparer.Ordinal);
|
||||
|
||||
/// How many QTC lines have gone with each station, either way. It is kept
|
||||
/// here rather than counted when a station is judged, because the bandmap
|
||||
/// judges every spot it holds on every pass.
|
||||
private readonly Dictionary<string, int> trafficWith = new(StringComparer.OrdinalIgnoreCase);
|
||||
private readonly HashSet<string> claimedMultipliers = new(StringComparer.Ordinal);
|
||||
private readonly Dictionary<ScoreKey, ScoreTally> rows = [];
|
||||
private ScoreTally tally = new();
|
||||
@@ -56,6 +61,10 @@ public sealed class ContestLog
|
||||
|
||||
public int TotalScore => contest.TotalScore(tally, Entry);
|
||||
|
||||
/// How many QTC lines have already gone with this station, either way.
|
||||
public int TrafficWith(string call) =>
|
||||
trafficWith.TryGetValue(call.Trim(), out int count) ? count : 0;
|
||||
|
||||
/// What logging this contact right now would do, without logging it.
|
||||
public Verdict Judge(Qso candidate)
|
||||
{
|
||||
@@ -68,9 +77,10 @@ public sealed class ContestLog
|
||||
{
|
||||
return new Verdict(false, contest.PointsFor(context), []);
|
||||
}
|
||||
int trafficLeft = contest.TrafficLeft(context, TrafficWith(candidate.Call.Text));
|
||||
if (IsWorked(candidate))
|
||||
{
|
||||
return Verdict.Dupe;
|
||||
return Verdict.Dupe with { TrafficLeft = trafficLeft };
|
||||
}
|
||||
List<Multiplier> newOnes = [];
|
||||
foreach (Multiplier multiplier in contest.MultipliersFor(context))
|
||||
@@ -83,7 +93,11 @@ public sealed class ContestLog
|
||||
// a contest can pay a bonus for a new multiplier, so the flags have to
|
||||
// be set before the points are worked out
|
||||
QsoContext scored = ContextFor(ApplyMultiplierFlags(candidate, newOnes));
|
||||
return new Verdict(false, IsContestMode(candidate) ? contest.PointsFor(scored) : 0, newOnes);
|
||||
return new Verdict(
|
||||
false,
|
||||
IsContestMode(candidate) ? contest.PointsFor(scored) : 0,
|
||||
newOnes,
|
||||
trafficLeft);
|
||||
}
|
||||
|
||||
/// Adds the contact and returns it with points and multiplier flags filled in.
|
||||
@@ -234,6 +248,8 @@ public sealed class ContestLog
|
||||
}
|
||||
if (!contest.IsContact(qso))
|
||||
{
|
||||
string station = qso.Call.Text.Trim();
|
||||
trafficWith[station] = trafficWith.GetValueOrDefault(station) + 1;
|
||||
return;
|
||||
}
|
||||
workedKeys[DupeKey(qso)] = qso.TimestampUtc;
|
||||
@@ -270,6 +286,7 @@ public sealed class ContestLog
|
||||
private void Rebuild()
|
||||
{
|
||||
workedKeys.Clear();
|
||||
trafficWith.Clear();
|
||||
claimedMultipliers.Clear();
|
||||
rows.Clear();
|
||||
tally = new ScoreTally();
|
||||
|
||||
@@ -86,6 +86,18 @@ public sealed class Wae : Contest
|
||||
|
||||
public bool IsContact(Qso qso) => !WaeQtc.IsQtc(qso);
|
||||
|
||||
/// Ten QTC lines with any one station, for the whole contest and whatever
|
||||
/// the band. Traffic goes between continents only: on CW and SSB that is
|
||||
/// the same line the contest itself is drawn on, and on RTTY it is any two
|
||||
/// continents that are not the same.
|
||||
public int TrafficLeft(QsoContext qso, int exchanged)
|
||||
{
|
||||
bool between = mode == ModeCategory.Digital
|
||||
? qso.Continent.Length > 0 && qso.Continent != qso.Me.Continent
|
||||
: IsWorkable(qso);
|
||||
return between ? Math.Max(0, WaeQtc.MostPerStation - exchanged) : 0;
|
||||
}
|
||||
|
||||
/// One multiplier per band, worth more the lower the band. For a station in
|
||||
/// Europe it is the other station's country or call area; for a station
|
||||
/// outside it, the European country worked.
|
||||
|
||||
@@ -3,10 +3,14 @@ namespace Nonemm.Contests;
|
||||
/// What the log says about a contact: whether it counts, what it scores, and
|
||||
/// which multipliers it brings in. Every window that colours a station reads
|
||||
/// this, so one station cannot look worked in one place and new in another.
|
||||
/// `TrafficLeft` is how many more QTC lines may be exchanged with the station,
|
||||
/// which is nought in every contest but WAE. A station with traffic left is
|
||||
/// worth working even as a dupe, and N1MM paints it in a colour of its own.
|
||||
public sealed record Verdict(
|
||||
bool IsDupe,
|
||||
int Points,
|
||||
IReadOnlyList<Multiplier> NewMultipliers)
|
||||
IReadOnlyList<Multiplier> NewMultipliers,
|
||||
int TrafficLeft = 0)
|
||||
{
|
||||
public static readonly Verdict Dupe = new(true, 0, []);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user