Editor/Modules/ArchLayerExtensions.cs
using Editor;
using Sandbox;

namespace Sunless.Architecture;

public interface IArchLayerMenu
{
	void Populate( Menu menu, ArchTool tool, ArchLayerNode layer );
}

public interface IArchSceneAddon
{
	void Apply( Scene scene, GameObject root, ArchPlan plan, ArchKit kit, ArchLayerTree layers );
}

public readonly record struct ArchOpeningSocket( Transform Frame, float Width, float Height, float Depth );

public static class ArchOpeningSockets
{
	public static ArchOpeningSocket Measure( ArchOpening opening, ArchWall wall, ArchKit kit, bool reverse = false )
	{
		var depth = ArchWallSection.Thickness( wall, kit );
		var sign = reverse ? 1f : -1f;
		var frame = new Transform(
			new Vector3( opening.Offset, sign * depth * 0.5f, opening.SillHeight ),
			Rotation.FromYaw( sign * 90f ) );

		return new ArchOpeningSocket( frame, opening.Width, opening.Height, depth );
	}
}