Editor/Road/ArchRoadManifest.cs

A manifest class for the "Road" architectural kind in the editor. It defines metadata for roads such as kind, slot, domain, label, glyph, subtool, hosting rules, child kinds, ranking, layer stage, and how to enumerate filed instances from a plan.

using System;
using System.Collections.Generic;

namespace Sunless.Architecture;

public sealed class ArchRoadManifest : ArchKindManifest<ArchRoadPart>
{
	public override ArchKind Kind => ArchKind.Road;

	// A road is a unit standing on the map beside the houses, so it is filed at the plan root and hosted by nothing.
	public override string Slot => "Units";

	public override ArchLayerDomain Domain => ArchLayerDomain.Infrastructure;

	public override string Label => "Road";

	public override string Glyph => "route";

	public override string Subtool => ArchSubtools.Road;

	public override bool RootsAtPlan => true;

	public override string HostOutput => "Road curve and section";

	public override IEnumerable<ArchKind> Children => new[]
	{
		ArchKind.Crossing, ArchKind.Bridge, ArchKind.Tunnel, ArchKind.Fence, ArchKind.Cut
	};

	public override int DirectRank => 21;

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

	public override IEnumerable<object> Filed( ArchPlan plan, object host )
	{
		if ( plan is null || host is not null )
		{
			return Array.Empty<object>();
		}

		return plan.Roads();
	}
}