Merge branch 'phase/36-person-card-tabs'
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
using System.Globalization;
|
||||
using Arch.Core;
|
||||
using HSchool.Ai;
|
||||
using HSchool.Content;
|
||||
@@ -6,33 +5,6 @@ using HSchool.People;
|
||||
|
||||
namespace HSchool.Simulation;
|
||||
|
||||
/// <summary>Log row types phase 36 will page. Captions are ready even while the card has no tab.</summary>
|
||||
public static class PersonLogTypes
|
||||
{
|
||||
public const string ApparelReplaced = "apparel-replaced";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// One thing that happened to a person today. Stored on the worker, not in <c>people.json</c>.
|
||||
/// The day boundary is six in the morning — the same hour skip lands on.
|
||||
/// </summary>
|
||||
public sealed record PersonLogEvent(string PersonId, DateTime Time, string Type, string? ThingDef)
|
||||
{
|
||||
public string Caption(DefCatalog catalog, string locale)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(catalog);
|
||||
if (!Type.Equals(PersonLogTypes.ApparelReplaced, StringComparison.Ordinal) || ThingDef is null)
|
||||
{
|
||||
return Type;
|
||||
}
|
||||
|
||||
var name = catalog.Things.TryGetValue(ThingDef, out var def)
|
||||
? catalog.Label(locale, def)
|
||||
: ThingDef;
|
||||
return string.Format(CultureInfo.InvariantCulture, catalog.Text(locale, "ApparelReplaced"), name);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Condition captions live in the catalog. The client draws what it is told.</summary>
|
||||
public static class ApparelCondition
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user