Update decision-making phase and enhance localization for presence tracking
ci / server (push) Failing after 3m40s
ci / client (push) Successful in 14s

- Marked tasks as complete in the decision-making phase documentation, indicating readiness for implementation.
- Updated the README to reflect the completion status of the decision-making phase.
- Enhanced localization strings to include new presence tracking features, improving user experience.
- Revised the game screen logic to display real-time presence status, including walking states for individuals.
- Added tests to validate the new localization strings and presence functionalities, ensuring robust performance.
This commit is contained in:
Leonid Pershin
2026-08-19 21:00:12 +03:00
parent b135a9caad
commit 5cd5a6d258
21 changed files with 1839 additions and 72 deletions
+16 -5
View File
@@ -69,17 +69,18 @@ internal static class ActivitySystem
return started;
}
public static void Apply(School school, double gameMinutes)
public static IReadOnlyList<string> Apply(School school, double gameMinutes)
{
if (school.Catalog is null || gameMinutes <= 0)
{
return;
return [];
}
var catalog = school.Catalog;
var minutes = (float)gameMinutes;
var completed = new List<string>();
var world = school.World;
world.Query(in People, (ref PersonNeeds needs, ref Presence presence, ref PersonActivity activity) =>
world.Query(in People, (ref PersonIdentity identity, ref PersonNeeds needs, ref Presence presence, ref PersonActivity activity) =>
{
if (!activity.IsActive)
{
@@ -92,11 +93,18 @@ internal static class ActivitySystem
return;
}
var location = school.Map?.NodeDef(presence.NodeId ?? "");
if (location is null || !location.Equals(action.Room, StringComparison.Ordinal))
{
activity = PersonActivity.Idle;
return;
}
var next = ActionStepper.Advance(
new ActivityProgress(activity.ActionId, activity.Thing, activity.RemainingMinutes),
minutes,
out var completed);
if (!completed)
out var finished);
if (!finished)
{
activity = new PersonActivity(next.ActionId, next.Thing, next.RemainingMinutes);
return;
@@ -110,7 +118,10 @@ internal static class ActivitySystem
}
activity = PersonActivity.Idle;
completed.Add(identity.Id);
});
completed.Sort(StringComparer.Ordinal);
return completed;
}
private static int Occupied(School school, string nodeId, string thing)