Enhance school day structure and decision-making for lunch breaks
- Updated `ai.md` to clarify the mechanics of hunger restoration and the importance of lunch breaks in the school schedule. - Revised `schedule.md` to detail the new lunch break structure, allowing for separate sittings for different grade levels. - Enhanced `Decision.cs` and `DecisionPlanner.cs` to incorporate logic for lunch breaks, ensuring that students only leave lessons during their designated lunch windows. - Updated `DayFrameDef` and related classes to support multiple lunch breaks and validate their configurations. - Adjusted tests to validate the new decision-making logic regarding lunch breaks and hunger management, ensuring robust functionality. - Improved localization strings to reflect changes in the school day structure and lunch functionalities.
This commit is contained in:
@@ -129,6 +129,37 @@ public class SkillGrantTests
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A school saved before native languages carries no pick, and the reload path asks for one
|
||||
/// with <c>rollIfOmitted: false</c>. The contract is that it takes the first listed language
|
||||
/// instead of rolling — a roll would change an existing school's tongue on the next start,
|
||||
/// and the intake after it would draw different people.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ReloadWithoutASavedPick_TakesTheFirstLanguageInsteadOfRolling()
|
||||
{
|
||||
var names = Fixtures.Catalog().NameSets["Slavic"];
|
||||
Assert.True(names.Spoken.Count > 1, "this pins behaviour that only matters for a multi-language set");
|
||||
|
||||
foreach (var seed in new[] { 1, 2, 7, 20260818 })
|
||||
{
|
||||
Assert.Equal(names.Spoken[0], NativeLanguages.Pick(names, seed, requested: null, rollIfOmitted: false));
|
||||
}
|
||||
|
||||
// A new school rolls instead, and the roll is stable for one seed.
|
||||
var rolled = NativeLanguages.Pick(names, 7, requested: null, rollIfOmitted: true);
|
||||
Assert.Contains(rolled, names.Spoken);
|
||||
Assert.Equal(rolled, NativeLanguages.Pick(names, 7, requested: null, rollIfOmitted: true));
|
||||
|
||||
// A saved pick is honoured whichever way it is asked for.
|
||||
Assert.Equal(
|
||||
names.Spoken[^1],
|
||||
NativeLanguages.Pick(names, 7, names.Spoken[^1], rollIfOmitted: false));
|
||||
|
||||
// Anything outside the set comes back null so the create path can answer 400.
|
||||
Assert.Null(NativeLanguages.Pick(names, 7, "Klingon", rollIfOmitted: true));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OmittedNativeLanguage_IsStableForTheSameSeed()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user