Write N1MM's own Contest table rows for the built-in contests
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,12 +5,30 @@ using Nonemm.Storage;
|
||||
namespace Nonemm.Session;
|
||||
|
||||
/// Turns a contest's rules into the definition row N1MM keeps in the `Contest`
|
||||
/// table, which it reads when it opens a log.
|
||||
/// table, which it reads when it opens a log. A built-in contest takes N1MM's
|
||||
/// own row; any other is worked out from its rules.
|
||||
public static class ContestDefinitions
|
||||
{
|
||||
public static ContestDefinition For(Contest contest, StationInfo me)
|
||||
{
|
||||
IReadOnlyList<string> mults = N1mmMultiplierNames.For(contest, me);
|
||||
if (N1mmContestRows.Find(contest.Name) is { } row)
|
||||
{
|
||||
return new ContestDefinition
|
||||
{
|
||||
Name = contest.Name,
|
||||
DisplayName = row.DisplayName,
|
||||
CabrilloName = row.CabrilloName,
|
||||
Mode = row.Mode,
|
||||
DupeType = row.DupeType,
|
||||
Multiplier1Name = NameAt(row.Multipliers, 0),
|
||||
Multiplier2Name = NameAt(row.Multipliers, 1),
|
||||
Multiplier3Name = NameAt(row.Multipliers, 2),
|
||||
Period = row.Period,
|
||||
PointsPerContact = row.PointsPerContact,
|
||||
CabrilloVersion = row.CabrilloVersion,
|
||||
};
|
||||
}
|
||||
IReadOnlyList<string> mults = contest.MultiplierNamesFor(me);
|
||||
return new ContestDefinition
|
||||
{
|
||||
Name = contest.Name,
|
||||
|
||||
Reference in New Issue
Block a user