Sample outdoor weather from the climate preset so people can freeze and the clock can show it.

Protocol v8 adds tenths of a °C and precipitation to the clock frame; warmth drains from insulation versus place temperature.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Leonid Pershin
2026-08-20 03:49:40 +03:00
co-authored by Cursor
parent d8f4958167
commit 8e7ab46e79
40 changed files with 1008 additions and 39 deletions
+39
View File
@@ -30,6 +30,11 @@ internal static class PeopleDefValidator
ValidateCountry(country, catalog);
}
foreach (var preset in catalog.ClimatePresets.Values)
{
ValidateClimatePreset(preset);
}
foreach (var subject in catalog.Subjects.Values)
{
ValidateSubject(subject, catalog);
@@ -576,6 +581,40 @@ internal static class PeopleDefValidator
ValidateNameSet(country.Names ?? new NameSetDef(), catalog, country.DefName);
}
private static void ValidateClimatePreset(ClimatePresetDef preset)
{
if (preset.Abstract)
{
return;
}
if (preset.MonthlyNorms.Count != 12)
{
throw new ContentLoadException(
$"ClimatePresetDef '{preset.DefName}' monthlyNorms must list 12 months.");
}
if (preset.DaySpread < 0 || preset.HourSpread < 0)
{
throw new ContentLoadException($"ClimatePresetDef '{preset.DefName}' spreads cannot be negative.");
}
if (preset.PrecipitationChance < 0 || preset.PrecipitationChance > 1)
{
throw new ContentLoadException($"ClimatePresetDef '{preset.DefName}' precipitationChance must be 01.");
}
if (preset.ComfortHalfWidthC < 0)
{
throw new ContentLoadException($"ClimatePresetDef '{preset.DefName}' comfortHalfWidthC cannot be negative.");
}
if (preset.InsulationPerC < 0)
{
throw new ContentLoadException($"ClimatePresetDef '{preset.DefName}' insulationPerC cannot be negative.");
}
}
private static void ValidateNameSet(NameSetDef names, DefCatalog catalog, string countryDefName)
{
if (!NameGrammar.IsKnownPatronymic(names.PatronymicRule))