Enhance staffing management in school simulation by introducing API endpoints for hiring staff and assigning subjects. Implement payroll cap validation to ensure hiring and subject assignments do not exceed the allocated budget. Update the simulation options to include a monthly payroll cap and revise related classes to support new staffing functionalities. Enhance documentation to reflect these changes and update tests to validate the new features.
This commit is contained in:
@@ -296,6 +296,16 @@ internal static class PeopleDefValidator
|
||||
{
|
||||
throw new ContentLoadException($"StaffingDef '{staffing.DefName}' wage scale cannot be negative.");
|
||||
}
|
||||
|
||||
if (staffing.BaseWeeklyHours <= 0f || staffing.WeeksPerMonth <= 0f)
|
||||
{
|
||||
throw new ContentLoadException($"StaffingDef '{staffing.DefName}' monthly hours must be positive.");
|
||||
}
|
||||
|
||||
if (staffing.ExtraSubjectSurcharge < 0f)
|
||||
{
|
||||
throw new ContentLoadException($"StaffingDef '{staffing.DefName}' extraSubjectSurcharge cannot be negative.");
|
||||
}
|
||||
}
|
||||
|
||||
private static void ValidateNameSet(NameSetDef names)
|
||||
|
||||
Reference in New Issue
Block a user