Phase 40: clock tempo at 1 min/s, x5/x10 heavy stride.

This commit is contained in:
Leonid Pershin
2026-08-20 07:02:24 +03:00
parent 2a55a025f4
commit 9199ea36d2
16 changed files with 192 additions and 57 deletions
+40 -16
View File
@@ -116,6 +116,12 @@ public sealed class School : IDisposable
internal int DecisionBudget { get; set; }
internal int HeavySystemsInvocations { get; private set; }
internal double LastHeavyGameMinutes { get; private set; }
private int _impulseCounter;
public int PendingDecisionCount => DecisionQueue.Count;
/// <summary>
@@ -303,24 +309,14 @@ public sealed class School : IDisposable
LastDecisionSlot = null;
}
PresenceSystem.Apply(this, gameMinutes);
foreach (var id in ActivitySystem.Apply(this, gameMinutes))
{
PresenceSystem.Enqueue(this, id);
}
SyncWeather(force: false);
PersonDayLog.Sync(this);
if (Catalog is not null)
_impulseCounter++;
var stride = ClockSpeed.HeavySystemsStride(Clock.SpeedIndex);
if (_impulseCounter % stride == 0)
{
var below = PresenceSystem.BelowThreshold(this);
SyncWeather(force: false);
NeedDecay.Apply(World, Catalog, gameMinutes);
WarmthDecay.Apply(this, gameMinutes);
PresenceSystem.EnqueueNewlyUrgent(this, below);
PresenceSystem.DrainDecisions(this);
LessonLearningSystem.Apply(this, gameMinutes);
peopleChanged |= ApparelWear.Apply(this, gameMinutes, before);
var heavyMinutes = ClockSpeed.HeavyGameMinutes(Clock.SpeedIndex, gameMinutes);
peopleChanged |= ApplyHeavySystems(heavyMinutes);
}
}
else
@@ -331,6 +327,34 @@ public sealed class School : IDisposable
return peopleChanged;
}
private bool ApplyHeavySystems(double gameMinutes)
{
HeavySystemsInvocations++;
LastHeavyGameMinutes = gameMinutes;
var peopleChanged = false;
PresenceSystem.Apply(this, gameMinutes);
foreach (var id in ActivitySystem.Apply(this, gameMinutes))
{
PresenceSystem.Enqueue(this, id);
}
PersonDayLog.Sync(this);
if (Catalog is not null)
{
var below = PresenceSystem.BelowThreshold(this);
NeedDecay.Apply(World, Catalog, gameMinutes);
WarmthDecay.Apply(this, gameMinutes);
PresenceSystem.EnqueueNewlyUrgent(this, below);
PresenceSystem.DrainDecisions(this);
LessonLearningSystem.Apply(this, gameMinutes);
peopleChanged |= ApparelWear.Apply(this, gameMinutes, Clock.Time.AddMinutes(-gameMinutes));
}
return peopleChanged;
}
/// <summary>
/// Recomputes the street from the preset, seed and current time. Commits when the clock
/// tenths or precipitation change, so warmth does not jitter every tick. A skip must force