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:
@@ -19,6 +19,7 @@ public enum DefKind
|
||||
Staffing,
|
||||
DayFrame,
|
||||
Holiday,
|
||||
Behavior,
|
||||
}
|
||||
|
||||
/// <summary>Shared JSONC fields. Kind comes from the folder under <c>defs/</c>, not from the file.</summary>
|
||||
@@ -31,7 +32,29 @@ public abstract class Def
|
||||
public bool Abstract { get; init; }
|
||||
}
|
||||
|
||||
public sealed class ActionDef : Def;
|
||||
public sealed class ActionDef : Def
|
||||
{
|
||||
/// <summary>RoomDef or TerritoryDef where this is done. Required on concrete actions.</summary>
|
||||
public string? Room { get; init; }
|
||||
|
||||
/// <summary>Thing occupied for the duration. Null means the room itself is enough.</summary>
|
||||
public string? Thing { get; init; }
|
||||
|
||||
/// <summary>Game minutes the action takes. Applied in full when it completes.</summary>
|
||||
public float Minutes { get; init; }
|
||||
|
||||
/// <summary>NeedDef refilled on completion. Null for walks and other leisure with no refill.</summary>
|
||||
public string? Need { get; init; }
|
||||
|
||||
/// <summary>Added to the need in one shot when the action finishes, then clamped to min–max.</summary>
|
||||
public float NeedGain { get; init; }
|
||||
|
||||
/// <summary>Empty means every role. Values are <see cref="PersonRoles"/> ids.</summary>
|
||||
public IReadOnlyList<string> Roles { get; init; } = [];
|
||||
|
||||
/// <summary>Leisure weight. Zero means phase 21 will not pick this for fun — only for a need.</summary>
|
||||
public float Weight { get; init; }
|
||||
}
|
||||
|
||||
public sealed class ThingDef : Def
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user