Persist talk opinions and pick topics by weight.
A finished circle never set Tick's peopleChanged bit, so people.json kept pre-talk numbers until morning drift. PickTopic compared a 0..total roll to a 0..1 cursor, so gossip almost never changed the subject. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -136,6 +136,12 @@ public sealed class School : IDisposable
|
||||
|
||||
internal Dictionary<string, string> TalkCircleByPerson { get; } = new(StringComparer.Ordinal);
|
||||
|
||||
/// <summary>
|
||||
/// A finished or interrupted circle wrote opinions onto the roster. <see cref="Tick"/>
|
||||
/// returns this so the worker persists <c>people.json</c> — same seam as morning dress.
|
||||
/// </summary>
|
||||
internal bool RosterTalkDirty { get; set; }
|
||||
|
||||
internal void ResetDayLog()
|
||||
{
|
||||
_dayLog.Clear();
|
||||
@@ -397,6 +403,8 @@ public sealed class School : IDisposable
|
||||
peopleChanged |= AffinitySystem.Apply(this, talked);
|
||||
}
|
||||
|
||||
peopleChanged |= RosterTalkDirty;
|
||||
RosterTalkDirty = false;
|
||||
return peopleChanged;
|
||||
}
|
||||
|
||||
|
||||
@@ -457,6 +457,7 @@ internal static class TalkCircleSystem
|
||||
}
|
||||
|
||||
school.TalkCirclesById.Remove(circle.Id);
|
||||
school.RosterTalkDirty = true;
|
||||
}
|
||||
|
||||
private static bool TryCatchWhisper(School school, ActiveTalkCircle circle)
|
||||
|
||||
Reference in New Issue
Block a user