Editor/Platform/ArchPlatformManifest.cs

Editor manifest for the Platform architecture kind. Defines metadata for the Platform kind: slot, hosts, label, glyph, editor subtool, child kinds, rank, layer stage, and how to get outline loops and height from an ArchPlatformPart payload.

Reflection
using System;
using System.Collections.Generic;
using System.Linq;
using Sandbox;

namespace Sunless.Architecture;

public sealed class ArchPlatformManifest : ArchKindManifest<ArchPlatformPart>
{
	public override ArchKind Kind => ArchKind.Platform;

	public override string Slot => "Platforms";

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

	public override string Label => "Platform";

	public override string Glyph => "crop_landscape";

	public override string Subtool => ArchSubtools.Bool;

	public override string HostOutput => "Platform body and deck";

	public override IEnumerable<ArchKind> Children => new[]
	{
		ArchKind.CarvedStair, ArchKind.Trim, ArchKind.Pillar
	};

	public override int DirectRank => 15;

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

	public override IReadOnlyList<List<Vector2>> Loops( object payload )
	{
		return payload is ArchPlatformPart platform
			? new List<List<Vector2>> { platform.Outline() }
			: base.Loops( payload );
	}

	public override float Height( object payload, float fallback )
	{
		return payload is ArchPlatformPart platform ? platform.TopHeight : fallback;
	}
}