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.
This commit is contained in:
@@ -94,6 +94,27 @@ public class PeopleDefTests
|
||||
Assert.Contains("Missing", ex.Message);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The derived build is computed from these two by name. A pack that renames them used to
|
||||
/// load fine and hand every single person the fallback height and weight — and therefore the
|
||||
/// same build, which then drives every body limit on every skill.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void BodyAttributesWithoutHeightOrWeight_FailTheCatalog()
|
||||
{
|
||||
var ex = Assert.Throws<ContentLoadException>(() => _loader.Load(
|
||||
[CatalogLoader.CorePackId],
|
||||
[
|
||||
PackDocuments.Def(
|
||||
CatalogLoader.CorePackId,
|
||||
"bodies",
|
||||
"stature",
|
||||
"""{ "defName": "Stature", "kind": "number", "distributions": [ { "distribution": { "mean": 170, "stdDev": 8 } } ] }"""),
|
||||
]));
|
||||
|
||||
Assert.Contains("Height", ex.Message);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void UnknownBuildValue_FailsTheCatalog()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user