Update decision-making phase and enhance localization for presence tracking
- 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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user