Wear worn clothes on campus and replace rags at the work morning.

Condition drops from catalog hours only while the person is at school; skip through the night issues the same fresh set as a lived night so the school does not walk in in rags.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Leonid Pershin
2026-08-20 03:49:11 +03:00
co-authored by Cursor
parent af90bb9f9d
commit 1ba739dd9b
20 changed files with 847 additions and 28 deletions
+14 -2
View File
@@ -16,6 +16,7 @@ public sealed class School : IDisposable
public const int MaxNameLength = 40;
private bool _disposed;
private readonly List<PersonLogEvent> _dayLog = [];
internal School(int id, string name, DateTime startDate, DefCatalog? catalog, MapLayout? map)
{
@@ -111,6 +112,15 @@ public sealed class School : IDisposable
public int PendingDecisionCount => DecisionQueue.Count;
/// <summary>
/// Today's history for phase 36. Cleared at six in the morning. Not written to disk.
/// </summary>
public IReadOnlyList<PersonLogEvent> DayLog => _dayLog;
internal void ResetDayLog() => _dayLog.Clear();
internal void AppendDayLog(PersonLogEvent row) => _dayLog.Add(row);
public void QueueDecision(string personId)
{
ObjectDisposedException.ThrowIf(_disposed, this);
@@ -208,6 +218,7 @@ public sealed class School : IDisposable
PlanDay = null;
LastDecisionSlot = null;
NeedDecay.Apply(World, Catalog, (next.Value - before).TotalMinutes);
peopleChanged |= ApparelWear.Apply(this, gameMinutes: 0, before);
return new SkipEmptyResult(SkipEmptyError.None, next.Value, peopleChanged);
}
@@ -246,8 +257,8 @@ public sealed class School : IDisposable
}
}
/// <summary>Runs one fixed step of the school: calendar, yearly intake, applicant refresh, presence, actions, then need decay.</summary>
/// <returns><see langword="true"/> when the roster or the applicant pool changed this step.</returns>
/// <summary>Runs one fixed step of the school: calendar, yearly intake, applicant refresh, presence, actions, need decay, then apparel wear.</summary>
/// <returns><see langword="true"/> when the roster, applicant pool or wardrobe changed this step.</returns>
public bool Tick(double deltaTime, double gameMinutesPerRealSecond)
{
ObjectDisposedException.ThrowIf(_disposed, this);
@@ -278,6 +289,7 @@ public sealed class School : IDisposable
PresenceSystem.EnqueueNewlyUrgent(this, below);
PresenceSystem.DrainDecisions(this);
LessonLearningSystem.Apply(this, gameMinutes);
peopleChanged |= ApparelWear.Apply(this, gameMinutes, before);
}
}