Editor manifest for the Pipe arch kind. It defines metadata for pipe parts including kind, editor slot, host types, label, glyph, subtool, layer stage, and a Wide method that returns all pipe parts across buildings in a plan.
using System;
using System.Collections.Generic;
using System.Linq;
namespace Sunless.Architecture;
public sealed class ArchPipeManifest : ArchKindManifest<ArchPipePart>, IArchReachesWide
{
public override ArchKind Kind => ArchKind.Pipe;
public override string Slot => "Pipes";
public override IEnumerable<Type> Hosts => new[] { typeof( ArchBuilding ) };
public override string Label => "Pipe run";
public override string Glyph => ArchIcons.Get( "subtool_pipe", "water_damage" );
public override string Subtool => ArchSubtools.Pipe;
public override ArchLayerStage Stage( object payload ) => ArchLayerStage.Fixture;
// What a corridor steps over is every other corridor in the plan, so one moving inside its own group
// changes a run in somebody else's.
public IEnumerable<object> Wide( ArchPlan plan )
{
return plan?.Buildings.SelectMany( building => building.Pipes ) ?? Array.Empty<ArchPipePart>();
}
}