Enhance protocol and simulation features with activity tracking and behavior definitions

- Updated protocol documentation to include new `activity` and `activityLabel` fields in the person card response, reflecting real-time activity status.
- Introduced `BehaviorDef` to define behavior rules, including need thresholds and lesson skill gains, enhancing AI decision-making.
- Revised the `DefCatalog` to incorporate behavior definitions and updated validation logic to ensure proper behavior handling.
- Enhanced the simulation to manage presence and activity states, allowing for more dynamic interactions within the school environment.
- Updated tests to validate the new activity tracking and behavior functionalities, ensuring robust performance and reliability.
- Improved localization strings to support new activity and behavior features, enhancing user experience.
This commit is contained in:
Leonid Pershin
2026-08-19 19:49:44 +03:00
parent 3c54f981b7
commit b135a9caad
42 changed files with 1134 additions and 59 deletions
@@ -64,6 +64,19 @@ public class VanillaCoreTests
Assert.Equal(3f, catalog.Territories["SchoolYard"].TravelMinutes);
Assert.Equal(4, catalog.Traits["Diligent"].CommuteMinutes);
Assert.Equal(-4, catalog.Traits["Lazy"].CommuteMinutes);
Assert.True(catalog.Actions["Sit"].Abstract);
Assert.Equal("Cafeteria", catalog.Actions["EatLunch"].Room);
Assert.Equal("Chair", catalog.Actions["EatLunch"].Thing);
Assert.Equal(15f, catalog.Actions["EatLunch"].Minutes);
Assert.Equal("Hunger", catalog.Actions["EatLunch"].Need);
Assert.Equal(0.5f, catalog.Actions["EatLunch"].NeedGain);
Assert.Equal("SchoolYard", catalog.Actions["WalkYard"].Room);
Assert.Equal(0.1f, catalog.Needs["Hunger"].DecayPerHour);
Assert.True(catalog.Needs["Sleep"].RestoredOffCampus);
Assert.NotNull(catalog.BehaviorRules);
Assert.Equal(0, catalog.BehaviorRules.CommuteSlackMin);
Assert.Equal(6, catalog.BehaviorRules.CommuteSlackMax);
Assert.Equal(0.35f, catalog.BehaviorRules.NeedThreshold);
}
/// <summary>
@@ -97,6 +110,7 @@ public class VanillaCoreTests
keys.AddRange(Names(catalog.Staffing.Values));
keys.AddRange(Names(catalog.DayFrames.Values));
keys.AddRange(Names(catalog.Holidays.Values));
keys.AddRange(Names(catalog.Behavior.Values));
// Derived in code, so no def carries them.
keys.Add(BodyBuilds.Attribute);