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:
Leonid Pershin
2026-08-20 13:34:34 +03:00
co-authored by Cursor
parent 8d07b3606d
commit b38d0bb628
9 changed files with 298 additions and 2 deletions
@@ -151,6 +151,28 @@ public class TalkCircleTests
}
}
[Fact]
public void TalkCircleFinish_MarksTickPeopleChangedSoSaveWritesOpinions()
{
var (school, first, second) = TwoPupilsOnBreak();
using (school)
{
OpinionStore.Set(first, second.Id, 10);
PlaceAt(school, first.Id, "corridor-1");
PlaceAt(school, second.Id, "corridor-1");
Assert.True(school.TryStartAction(first.Id, TalkActions.Chat));
var peopleChanged = false;
while (ActivityOf(school, first.Id) is not null)
{
peopleChanged |= school.Tick(0.2d, 5d);
}
Assert.True(peopleChanged);
Assert.NotEqual(10, OpinionStore.Get(first, second.Id));
}
}
private static (School School, Person First, Person Second) TwoPupilsWithPhonesOnBreak()
{
var (catalog, map) = Vanilla();