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
+26
View File
@@ -0,0 +1,26 @@
namespace HSchool.People;
/// <summary>
/// A country lists climate presets; the school rolls one at birth from the school seed.
/// Reloads without a stored pick take the first listed preset so old saves stay put.
/// </summary>
public static class CountryClimate
{
public static string? Pick(CountryDef country, int schoolSeed, bool rollIfOmitted)
{
ArgumentNullException.ThrowIfNull(country);
var presets = country.ClimatePresets;
if (presets.Count == 0)
{
return null;
}
if (!rollIfOmitted || presets.Count == 1)
{
return presets[0];
}
var rng = new Random(Seed.ForSchool(schoolSeed, Seed.ClimatePresetSalt));
return presets[rng.Next(presets.Count)];
}
}