Enhance school simulation management by introducing a new SchoolWeekDays option, allowing configuration of the number of working days in a week. Update the API to include school week days in responses and enhance documentation to reflect these changes. Revise UI components to support the new management features, ensuring a seamless user experience when hiring and assigning staff. Update localization strings for improved clarity and consistency across the application.
This commit is contained in:
@@ -88,6 +88,8 @@ internal sealed record CatalogResponse(
|
||||
IReadOnlyList<DefInfoResponse> Things,
|
||||
IReadOnlyList<DefInfoResponse> NameSets,
|
||||
IReadOnlyList<SubjectInfoResponse> Subjects,
|
||||
DayFrameResponse? DayFrame,
|
||||
IReadOnlyList<HolidayInfoResponse> Holidays,
|
||||
MapLayout DefaultMap)
|
||||
{
|
||||
public static CatalogResponse From(DefCatalog catalog, MapLayout map, string locale) =>
|
||||
@@ -99,6 +101,8 @@ internal sealed record CatalogResponse(
|
||||
PlaceableThings(catalog, locale),
|
||||
Placeable(catalog.NameSets.Values, catalog, locale),
|
||||
PlaceableSubjects(catalog, locale),
|
||||
MapDayFrame(catalog, locale),
|
||||
PlaceableHolidays(catalog, locale),
|
||||
map);
|
||||
|
||||
private static IReadOnlyList<DefInfoResponse> Placeable<T>(IEnumerable<T> defs, DefCatalog catalog, string locale)
|
||||
@@ -140,7 +144,35 @@ internal sealed record CatalogResponse(
|
||||
def.Grades.Min,
|
||||
def.Grades.Max,
|
||||
def.HoursPerWeek,
|
||||
def.Skills.Select(share => new SubjectSkillInfo(share.Skill, share.Share)).ToArray()))
|
||||
def.Skills.Select(share => new SubjectSkillInfo(share.Skill, share.Share)).ToArray(),
|
||||
def.Room))
|
||||
.ToArray();
|
||||
|
||||
private static DayFrameResponse? MapDayFrame(DefCatalog catalog, string locale)
|
||||
{
|
||||
var frame = catalog.DayFrame;
|
||||
return frame is null
|
||||
? null
|
||||
: new DayFrameResponse(
|
||||
frame.DefName,
|
||||
catalog.Label(locale, frame),
|
||||
frame.FirstLesson,
|
||||
frame.LessonCount,
|
||||
frame.LessonMinutes,
|
||||
frame.BreakMinutes,
|
||||
frame.LongBreakAfter,
|
||||
frame.LongBreakMinutes);
|
||||
}
|
||||
|
||||
private static IReadOnlyList<HolidayInfoResponse> PlaceableHolidays(DefCatalog catalog, string locale) =>
|
||||
catalog.Holidays.Values
|
||||
.Where(def => !def.Abstract)
|
||||
.OrderBy(def => def.DefName, StringComparer.Ordinal)
|
||||
.Select(def => new HolidayInfoResponse(
|
||||
def.DefName,
|
||||
catalog.Label(locale, def),
|
||||
def.Start,
|
||||
def.End))
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
@@ -165,4 +197,17 @@ internal sealed record SubjectInfoResponse(
|
||||
int GradeMin,
|
||||
int GradeMax,
|
||||
int HoursPerWeek,
|
||||
IReadOnlyList<SubjectSkillInfo> Skills);
|
||||
IReadOnlyList<SubjectSkillInfo> Skills,
|
||||
string? Room);
|
||||
|
||||
internal sealed record DayFrameResponse(
|
||||
string DefName,
|
||||
string Label,
|
||||
string FirstLesson,
|
||||
int LessonCount,
|
||||
int LessonMinutes,
|
||||
int BreakMinutes,
|
||||
int LongBreakAfter,
|
||||
int LongBreakMinutes);
|
||||
|
||||
internal sealed record HolidayInfoResponse(string DefName, string Label, MonthDay Start, MonthDay End);
|
||||
|
||||
Reference in New Issue
Block a user