Merge branch 'phase/74-attendance'

This commit is contained in:
Leonid Pershin
2026-08-21 13:15:05 +03:00
13 changed files with 836 additions and 12 deletions
+11
View File
@@ -722,6 +722,17 @@ internal static class PeopleDefValidator
previous = floor;
}
}
if (behavior.AttendanceMax < 0)
{
throw new ContentLoadException($"BehaviorDef '{behavior.DefName}' attendanceMax cannot be negative.");
}
if (behavior.LessonLateMinutes < 0f)
{
throw new ContentLoadException(
$"BehaviorDef '{behavior.DefName}' lessonLateMinutes cannot be negative.");
}
}
private static void ValidateTopic(TopicDef topic, DefCatalog catalog)
+17
View File
@@ -619,6 +619,23 @@ public sealed class BehaviorDef : Def
/// </summary>
public int? LessonMarkWhenNoTeacher { get; init; } = 2;
/// <summary>
/// How many recent attendance rows a person keeps. Oldest drop first. Zero disables attendance.
/// </summary>
public int AttendanceMax { get; init; } = 40;
/// <summary>
/// Minutes after the bell: first standing in the room within this window is present;
/// later is late. Inclusive — arrival at exactly this many minutes still counts as present.
/// </summary>
public float LessonLateMinutes { get; init; } = 5f;
/// <summary>
/// When true (vanilla), a late arrival still receives a lesson mark if they are standing in
/// the room — stage A quality path. False skips the mark for late pupils.
/// </summary>
public bool LessonMarkWhenLate { get; init; } = true;
public static IReadOnlyList<float> DefaultLessonMarkThresholds { get; } =
[
0.85f,