Enhance family and roster management in school simulation by implementing support for incomplete families, ensuring proper handling of absent parents while maintaining surname consistency. Update family creation logic to account for single-parent households and revise child identification to prevent ID conflicts. Introduce seat shuffling to prevent siblings from being placed in the same class, improving the realism of student distribution. Update related tests to validate these new functionalities and ensure robustness in family and roster handling.
ci / server (push) Failing after 3m49s
ci / client (push) Successful in 24s

This commit is contained in:
Leonid Pershin
2026-08-18 21:13:16 +03:00
parent 7f6852548d
commit 3366e8e44b
19 changed files with 766 additions and 90 deletions
+29
View File
@@ -28,6 +28,35 @@ internal static class PeopleDefValidator
{
ValidateNameSet(names);
}
RequireBuildInputs(catalog);
}
/// <summary>
/// The derived build reads these two by name. A pack without them would leave every person
/// on the fallback height and weight, and the whole build column would read "Average".
/// </summary>
private static void RequireBuildInputs(DefCatalog catalog)
{
if (catalog.BodyAttributes.Count == 0)
{
return;
}
foreach (var required in new[] { BodyBuilds.HeightAttribute, BodyBuilds.WeightAttribute })
{
if (!catalog.BodyAttributes.TryGetValue(required, out var def) || def.Abstract)
{
throw new ContentLoadException(
$"BodyAttributeDef '{required}' is required: the derived build is computed from it.");
}
if (def.Kind != BodyAttributeKind.Number)
{
throw new ContentLoadException(
$"BodyAttributeDef '{required}' must be a number: the derived build is computed from it.");
}
}
}
private static void ValidateBody(BodyAttributeDef def)