Editor/Wall/ArchBalconyGen.cs

Editor-side generator for balcony architecture parts. It resolves balcony shape, optionally builds the projecting slab platform, and if a rail is present it builds a balustrade fixture using platform/barrier generators and style palettes.

File Access
namespace Sunless.Architecture;

// Nothing here emits a solid of its own: the deck and its coping are the platform engine, the balustrade
// is the barrier engine, and a loggia's own floor is the storey slab the cut left standing.
public static class ArchBalconyGen
{
	public static void Build( ArchMesh canvas, ArchBalconyPart balcony, ArchBuilding building, ArchPlan plan, ArchKit kit, ArchStyle style )
	{
		var shape = ArchBalcony.Resolve( balcony, building, kit );
		var chain = new[] { balcony.Palette, building.Palette };

		if ( shape.Projects )
		{
			using ( canvas.Part( ArchPieces.Balcony ) )
			{
				ArchPlatformGen.Build( canvas, ArchBalcony.Slab( balcony, shape ), building, plan, kit, style );
			}
		}

		if ( !shape.Rail )
		{
			return;
		}

		using ( canvas.Part( ArchPieces.Balustrade ) )
		{
			ArchFixtureGuard.Build( canvas, shape.Edge(), kit, shape.RailHeight, BarrierGround.Level, ArchBarrierBrushes.Of( style, chain ) );
		}
	}
}