Implement applicant pool functionality in school simulation, allowing for the management of job seekers who are not yet part of the school roster. Update the catalog to include staffing definitions and enhance the API to support applicant data retrieval. Revise the school architecture to handle applicant refresh logic and ensure proper integration with existing roster management. Update tests to validate the new applicant functionalities and ensure robustness in handling staffing scenarios.
This commit is contained in:
@@ -3,6 +3,7 @@ namespace HSchool.People;
|
||||
/// <summary>
|
||||
/// Whether a generated or loaded roster still fills this map. A mismatch means the file is stale
|
||||
/// relative to the layout — the school must not start and the file must stay untouched.
|
||||
/// Staff openings are the player's to fill; only pupil seats have to be occupied.
|
||||
/// </summary>
|
||||
public static class RosterFit
|
||||
{
|
||||
@@ -24,24 +25,6 @@ public static class RosterFit
|
||||
}
|
||||
}
|
||||
|
||||
var staffed = roster.People
|
||||
.Where(person => person.IsStaff && person.Position is not null && person.WorkplaceRoomId is not null)
|
||||
.Select(person => new StaffOpening(person.WorkplaceRoomId!, person.Position!))
|
||||
.ToHashSet();
|
||||
|
||||
if (staffed.Count != demand.Staff.Count)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach (var opening in demand.Staff)
|
||||
{
|
||||
if (!staffed.Contains(opening))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user