Merge branch 'main' into phase/32-weather-warmth
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # src/HSchool.Simulation/School.cs
This commit is contained in:
@@ -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)
|
||||
{
|
||||
@@ -114,6 +115,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);
|
||||
@@ -212,6 +222,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);
|
||||
SyncWeather(force: true);
|
||||
return new SkipEmptyResult(SkipEmptyError.None, next.Value, peopleChanged);
|
||||
}
|
||||
@@ -251,8 +262,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);
|
||||
@@ -285,6 +296,7 @@ public sealed class School : IDisposable
|
||||
PresenceSystem.EnqueueNewlyUrgent(this, below);
|
||||
PresenceSystem.DrainDecisions(this);
|
||||
LessonLearningSystem.Apply(this, gameMinutes);
|
||||
peopleChanged |= ApparelWear.Apply(this, gameMinutes, before);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user