The score window and the stored Contest.Multiplier1Name row both said "Prefixes" for an Asian entrant, which counts DXCC entities. Contest.MultiplierNames is now MultiplierNamesFor(StationInfo me), the same shape as ExchangeFieldsFor. Every other contest returns the same list it did before; All Asian returns "Countries" from Asia and "Prefixes" from everywhere else. ContestDefinitions.For takes the station as well, because that name is written to the log for N1MM. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0157i7PiZyqBkquxS9A6FTdQ
69 lines
2.4 KiB
C#
69 lines
2.4 KiB
C#
using Nonemm.Core;
|
|
|
|
namespace Nonemm.Contests.Rules;
|
|
|
|
/// The SARTG World Wide RTTY contest. A contact inside your own country is 5
|
|
/// points, one on your own continent 10 and one from another 15. The countries
|
|
/// count once per band, and so do the US, Canadian and Japanese call areas.
|
|
public sealed class SartgRtty : Contest
|
|
{
|
|
public string Name => "SARTGRTTY";
|
|
|
|
public string DisplayName => "SARTG World Wide RTTY";
|
|
|
|
public string CabrilloName => "SARTG-RTTY";
|
|
|
|
public IReadOnlyList<ExchangeField> ExchangeFieldsFor(StationInfo me) =>
|
|
[
|
|
new ExchangeField("Snt", ExchangeSlot.SentReport, ExchangeFieldKind.Report, IsRequired: false),
|
|
new ExchangeField("Rcv", ExchangeSlot.ReceivedReport, ExchangeFieldKind.Report),
|
|
new ExchangeField("SntNR", ExchangeSlot.SentNumber, ExchangeFieldKind.Number, IsRequired: false),
|
|
new ExchangeField("RcvNr", ExchangeSlot.SerialNumber, ExchangeFieldKind.Number),
|
|
];
|
|
|
|
public IReadOnlyList<string> MultiplierNamesFor(StationInfo me) => ["Countries", "Areas"];
|
|
|
|
public DupeScope DupeScope => DupeScope.PerBand;
|
|
|
|
public bool HasSerialNumbers => true;
|
|
|
|
public IReadOnlyList<ModeCategory> Modes => [ModeCategory.Digital];
|
|
|
|
public string SentExchangeFor(StationInfo me) => "001";
|
|
|
|
public int PointsFor(QsoContext qso) =>
|
|
qso.IsSameCountry ? 5 : qso.IsSameContinent ? 10 : 15;
|
|
|
|
public IReadOnlyList<Multiplier> MultipliersFor(QsoContext qso)
|
|
{
|
|
string band = qso.Band?.Name ?? "";
|
|
List<Multiplier> found = [];
|
|
if (qso.CountryPrefix.Length > 0)
|
|
{
|
|
found.Add(new Multiplier(1, qso.CountryPrefix, band));
|
|
}
|
|
string area = qso.Qso.Section.Trim().ToUpperInvariant();
|
|
if (area.Length > 0)
|
|
{
|
|
found.Add(new Multiplier(2, area, band));
|
|
}
|
|
return found;
|
|
}
|
|
|
|
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),
|
|
]);
|
|
}
|