Editor/Geometry/ArchOutlineForm.cs
using System.Collections.Generic;
using Sandbox;

namespace Sunless.Architecture;

// The shape a drag stands. A box, or a circle authored as the box it is inscribed in plus a segment count - so both
// are the same gesture and the same loop, and everything downstream stops caring which.
public enum ArchBoolForm {
	Box,
	Circle
}

// Read back off a loop rather than stored, so an edited outline reports what it now IS.
public static class ArchOutlineForm {
	public static ArchBoolForm Of( IReadOnlyList<Vector2> loop ) {
		return loop is { Count: >= ArchFootprint.LeastSegments } && !ArchFootprint.IsRectilinear( loop )
			? ArchBoolForm.Circle
			: ArchBoolForm.Box;
	}
}