Editor/Data/ArchWallPreset.cs

Editor-side data class that defines a wall appearance preset. It stores properties like height, thickness, cladding, bands, trims, pilasters and opening runs, can spawn an ArchWall instance with those treatments applied, and can copy presets.

File Access
using System;
using System.Collections.Generic;
using System.Linq;
using Sandbox;

namespace Sunless.Architecture;

// Carries no geometry - the drag says where, this says how it is finished.
public sealed class ArchWallPreset : IArchWallTreatment
{
	public string Name { get; set; } = "wall";
	public float Height { get; set; }
	public float Thickness { get; set; }
	public bool Exterior { get; set; } = true;
	public bool SingleSided { get; set; }
	public bool Baseboard { get; set; } = true;
	public bool Cap { get; set; }
	public float CapHeight { get; set; }
	public float CapOverhang { get; set; }
	public WallCladding Cladding { get; set; }
	public bool Wainscot { get; set; }
	public List<ArchWallBand> Bands { get; set; } = new();
	public List<ArchWallTrim> Trims { get; set; } = new();
	public ArchPilasterRun Pilasters { get; set; } = new();
	public ArchOpeningRun OpeningRun { get; set; } = new();

	public ArchWall Spawn( int id, Vector2 start, Vector2 end )
	{
		var wall = new ArchWall { Id = id, Start = start, End = end };

		ArchWallTreatments.Dress( this, wall );

		return wall;
	}

	public static ArchWallPreset Copy( ArchWallPreset preset )
	{
		var result = new ArchWallPreset { Name = preset?.Name ?? "wall" };

		if ( preset is not null )
		{
			ArchWallTreatments.Dress( preset, result );
		}

		return result;
	}
}