Editor/Stair/ArchStairGuardManifest.cs

Editor manifest for a stair railing part. Defines kind, slot name, host types, UI label, glyph, subtool, host output text, rank, layer stage, and a display name based on the part payload.

Reflection
using System;
using System.Collections.Generic;

namespace Sunless.Architecture;

// A railing, as a row under the step it stands on. Filed on the step's own Guards list, so adding, restyling,
// reordering and deleting one all come off the slot with nothing written for them.
public sealed class ArchStairGuardManifest : ArchKindManifest<ArchStairGuardPart>
{
	public override ArchKind Kind => ArchKind.StairGuard;

	public override string Slot => "Guards";

	public override IEnumerable<Type> Hosts => new[] { typeof( ArchStairLane ) };

	public override string Label => "Railing";

	public override string Glyph => ArchIcons.Get( "opt_rails", "fence" );

	public override string Subtool => ArchSubtools.Stair;

	public override string HostOutput => "The edge it guards";

	public override int DirectRank => 4;

	public override ArchLayerStage Stage( object payload ) => ArchLayerStage.Shape;

	public override string DisplayName( object payload )
	{
		if ( payload is not ArchStairGuardPart guard )
		{
			return null;
		}

		return $"{guard.Railing} · {guard.Edge.ToString().ToLowerInvariant()}";
	}
}