Let the catalog describe clothes and carryables on ThingDef without dressing anyone.

Empty layers keep furniture on the map; a known layer set and ColorDef palette reject unknown ids at load.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Leonid Pershin
2026-08-20 02:47:23 +03:00
co-authored by Cursor
parent 450495f666
commit abcf67eaab
16 changed files with 716 additions and 15 deletions
+56
View File
@@ -0,0 +1,56 @@
namespace HSchool.Content;
/// <summary>
/// Layers apparel occupies. Code, not a def — new layers are a rebuild, like
/// <see cref="PersonRoles"/>.
/// </summary>
public static class ApparelLayers
{
public const string Underwear = "Underwear";
public const string Socks = "Socks";
public const string Bottom = "Bottom";
public const string Top = "Top";
public const string OverTop = "OverTop";
public const string Outer = "Outer";
public const string Shoes = "Shoes";
public const string Head = "Head";
public const string Accessory = "Accessory";
public static readonly IReadOnlyList<string> All =
[Underwear, Socks, Bottom, Top, OverTop, Outer, Shoes, Head, Accessory];
public static bool IsKnown(string layer) =>
All.Any(candidate => candidate.Equals(layer, StringComparison.Ordinal));
}
/// <summary>
/// ColorDef appropriateness tags. School rules filter these, not color names.
/// </summary>
public static class ColorTags
{
public const string Neutral = "neutral";
public const string Bright = "bright";
public const string School = "school";
public static readonly IReadOnlyList<string> All = [Neutral, Bright, School];
public static bool IsKnown(string tag) =>
All.Any(candidate => candidate.Equals(tag, StringComparison.Ordinal));
}
/// <summary>Bottom length for the short-form dress code. Omit on things that have no hem.</summary>
public static class SkirtLengths
{
public const string Regular = "regular";
public const string Short = "short";
public static readonly IReadOnlyList<string> All = [Regular, Short];
public static bool IsKnown(string length) =>
All.Any(candidate => candidate.Equals(length, StringComparison.Ordinal));
}
public sealed class ColorDef : Def
{
public IReadOnlyList<string> Tags { get; init; } = [];
}