Replace selectable name sets with a country that owns names and climate presets.

Create picks a country; climate is rolled from the school seed and stored. Old Slavic saves lift as Russia.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Leonid Pershin
2026-08-20 02:55:13 +03:00
co-authored by Cursor
parent 450495f666
commit 1b66c89cd7
58 changed files with 902 additions and 477 deletions
+9 -9
View File
@@ -15,12 +15,12 @@ public sealed record ApplicantPool(int Week, int NextIndex, IReadOnlyList<Applic
DefCatalog catalog,
Roster roster,
int schoolSeed,
string nameSetId,
string countryId,
DateTime asOf,
string? nativeLanguage = null)
{
var week = ApplicantWeeks.Id(asOf);
return Fill(catalog, roster, schoolSeed, nameSetId, asOf, new ApplicantPool(week, 0, []), nativeLanguage: nativeLanguage);
return Fill(catalog, roster, schoolSeed, countryId, asOf, new ApplicantPool(week, 0, []), nativeLanguage: nativeLanguage);
}
/// <summary>
@@ -31,7 +31,7 @@ public sealed record ApplicantPool(int Week, int NextIndex, IReadOnlyList<Applic
DefCatalog catalog,
Roster roster,
int schoolSeed,
string nameSetId,
string countryId,
DateTime asOf,
string? nativeLanguage = null)
{
@@ -44,7 +44,7 @@ public sealed record ApplicantPool(int Week, int NextIndex, IReadOnlyList<Applic
var pool = this;
for (var week = Week + 1; week <= target; week++)
{
pool = Step(pool, catalog, roster, schoolSeed, nameSetId, asOf, week, nativeLanguage);
pool = Step(pool, catalog, roster, schoolSeed, countryId, asOf, week, nativeLanguage);
}
return pool;
@@ -93,7 +93,7 @@ public sealed record ApplicantPool(int Week, int NextIndex, IReadOnlyList<Applic
DefCatalog catalog,
Roster roster,
int schoolSeed,
string nameSetId,
string countryId,
DateTime asOf,
int week,
string? nativeLanguage)
@@ -113,7 +113,7 @@ public sealed record ApplicantPool(int Week, int NextIndex, IReadOnlyList<Applic
catalog,
roster,
schoolSeed,
nameSetId,
countryId,
asOf,
new ApplicantPool(week, current.NextIndex, staying),
rng,
@@ -124,16 +124,16 @@ public sealed record ApplicantPool(int Week, int NextIndex, IReadOnlyList<Applic
DefCatalog catalog,
Roster roster,
int schoolSeed,
string nameSetId,
string countryId,
DateTime asOf,
ApplicantPool current,
Random? rng = null,
string? nativeLanguage = null)
{
var rules = RequireRules(catalog);
if (!catalog.NameSets.TryGetValue(nameSetId, out var names))
if (!catalog.TryGetCountryNames(countryId, out var names))
{
throw new ArgumentException($"Unknown name set '{nameSetId}'.", nameof(nameSetId));
throw new ArgumentException($"Unknown country '{countryId}'.", nameof(countryId));
}
var native = NativeLanguages.Pick(names, schoolSeed, nativeLanguage, rollIfOmitted: false);