Editor-side data model for a fence segment in the architecture editor. Defines picket top enum and ArchFencePart class that stores id, name, curve nodes, closed flag, collision override, barrier spec, palette, and a legacy path for migration; provides a Curve() helper.
using System;
using System.Collections.Generic;
using System.Linq;
using Sandbox;
namespace Sunless.Architecture;
public enum PicketTop
{
Pointed,
Flat,
Gothic
}
// What stands between the posts is the Barrier spec.
public sealed class ArchFencePart : IArchCollides, IArchPainted, IArchNamed
{
// Overrides the kit for THIS part alone: one wall that needs its exact holes, one tower that needs none.
public ArchCollisionMode? Collision { get; set; }
public int Id { get; set; }
public string Name { get; set; } = "Fence";
public List<ArchCurveNode> Nodes { get; set; } = new();
public bool Closed { get; set; }
public ArchBarrierSpec Barrier { get; set; } = new();
public ArchPalette Palette { get; set; } = new();
// Legacy migration - read by Normalize only; nothing else writes it.
public List<Vector3> Path { get; set; } = new();
public ArchCurve Curve() => ArchCurve.Of( Nodes, Closed );
}