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:
@@ -57,6 +57,33 @@ internal static class Fixtures
|
||||
return new MapLayout { Rooms = rooms };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// One tiny class and five posts: the pupils' parents cannot fill them, so the generator has
|
||||
/// to top the staff up, and the deficit is odd on purpose.
|
||||
/// </summary>
|
||||
public static MapLayout PostHeavyMap()
|
||||
{
|
||||
var rooms = new List<RoomNode>
|
||||
{
|
||||
new()
|
||||
{
|
||||
Id = "classroom-00",
|
||||
Def = "Classroom",
|
||||
Building = "main",
|
||||
Floor = "floor-1",
|
||||
Label = "101",
|
||||
Slots = [new SlotFill { Key = "studentDesks", Thing = "StudentDesk", Count = 1 }],
|
||||
},
|
||||
};
|
||||
|
||||
foreach (var def in new[] { "PrincipalsOffice", "SecretaryOffice", "Library", "MedicalOffice" })
|
||||
{
|
||||
rooms.Add(new RoomNode { Id = def, Def = def, Building = "main", Floor = "floor-1" });
|
||||
}
|
||||
|
||||
return new MapLayout { Rooms = rooms };
|
||||
}
|
||||
|
||||
public static Roster Generate(MapLayout map, int seed = SchoolSeed) =>
|
||||
RosterGenerator.Generate(Catalog(), map, seed, "Slavic", AsOf);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user