Editor/Layers/ArchKind.cs

A small value type representing a layer kind in the editor. It stores an identifier string, marks empty identifier as None, exposes Known and overrides ToString, and uses a custom JSON converter.

Http Calls
using System.Text.Json.Serialization;

namespace Sunless.Architecture;

// A layer's kind, contributed rather than enumerated, so a module can bring one this editor has never heard of.
// The ident IS the name already on disk - kinds have always serialized through a string converter - so every plan
// written before this type existed reads with no conversion at all.
[JsonConverter( typeof( ArchKindConverter ) )]
public readonly partial record struct ArchKind( string Ident )
{
	public static readonly ArchKind None = new( "" );

	public bool Known => !string.IsNullOrEmpty( Ident );

	public override string ToString() => Ident;
}