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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user