Editor/Stair/ArchStairSheet.cs

Editor sheet UI for an ArchStairPart. It exposes the payload type and builds the inspector panel with a button to open the stair drawing and delegates additional UI construction to ArchStairUi methods.

Reflection
namespace Sunless.Architecture;

public sealed class ArchStairSheet : IArchSheet
{
	public Type Payload => typeof( ArchStairPart );

	public void Build( ToolSidebarWidget panel, ArchTool tool, ArchSelection picked, Action refresh, Action changed )
	{
		if ( picked.Item is not ArchStairPart stair )
		{
			return;
		}

		panel.AddGroup( "Drawing" ).AddRow().Add( new Button.Primary( "Open the stair drawing", "draw" )
		{
			Clicked = () => ArchStairWindow.Open( tool, stair )
		} );

		ArchStairUi.Build( panel, stair, refresh, changed );
		ArchStairUi.Sizes( panel, stair, changed );
	}
}