Defines a small data holder and builder interface for constructing a flight (stair/room) in the editor. ArchFlightDrawing is an immutable record struct bundling mesh, stair, room, building, kit, style, door requests and plan. IArchFlightBuilder is the builder interface with a Build method. ArchFlightBuilders contains a static helper that resolves a single IArchFlightBuilder via ArchRoles.One<T>() and invokes it, returning success flag.
namespace Sunless.Architecture;
public readonly record struct ArchFlightDrawing(
ArchMesh Canvas,
ArchStairPart Stair,
ArchRoom Room,
ArchBuilding Building,
ArchKit Kit,
ArchStyle Style,
List<ArchDoorRequest> Doors,
ArchPlan Plan );
public interface IArchFlightBuilder
{
void Build( ArchFlightDrawing drawing );
}
public static class ArchFlightBuilders
{
public static bool Build( ArchFlightDrawing drawing )
{
if ( ArchRoles.One<IArchFlightBuilder>() is not { } builder )
{
return false;
}
builder.Build( drawing );
return true;
}
}