Editor UI sheets for roof parts. Defines two IArchSheet implementations that specify payload types and build sidebar UI by delegating to ArchRoofUi for roof, ridge, details, and light controls.
namespace Sunless.Architecture;
public sealed class ArchRoofSheet : IArchSheet
{
public Type Payload => typeof( ArchRoofPart );
public void Build( ToolSidebarWidget panel, ArchTool tool, ArchSelection picked, Action refresh, Action changed )
{
if ( picked.Item is not ArchRoofPart roof )
{
return;
}
ArchRoofUi.Build( panel, roof, refresh, changed, tool );
ArchRoofUi.Ridge( panel, roof, changed );
ArchRoofUi.Details( panel, roof, changed );
}
}
public sealed class ArchRoofLightSheet : IArchSheet
{
public Type Payload => typeof( ArchRoofLightPart );
public void Build( ToolSidebarWidget panel, ArchTool tool, ArchSelection picked, Action refresh, Action changed )
{
if ( picked.Item is ArchRoofLightPart light )
{
ArchRoofUi.Light( panel, light, tool.Kit, refresh, changed );
}
}
}