Editor/Road/ArchRoadLineCatalog.cs

Editor catalog for road marking presets. Implements IArchCatalog, returns a fixed list of ArchRoadLine instances in Markings and otherwise does not support authored entries or saving.

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

namespace Sunless.Architecture;

// Markings ship and are tuned on the kit; there is no folder of them, because a line is four numbers and naming
// one is the whole of authoring it.
public sealed class ArchRoadLineCatalog : IArchCatalog
{
	public ArchShelf Shelf => ArchShelf.RoadLines;

	public string Named( object entry ) => entry is ArchRoadLine line ? line.Name : null;

	public IEnumerable<object> Authored() => Array.Empty<object>();

	public bool Save( object entry ) => false;

	public IEnumerable<object> Shipped() => Markings();

	public static List<ArchRoadLine> Markings()
	{
		return new List<ArchRoadLine>
		{
			new() { Name = "solid_white" },
			new() { Name = "dashed_white", Dash = 120f, Gap = 240f },
			new() { Name = "short_dashed_white", Dash = 48f, Gap = 48f },
			new() { Name = "double_white", Count = 2, Separation = 5f },
			new() { Name = "solid_yellow" },
			new() { Name = "dashed_yellow", Dash = 120f, Gap = 240f },
			new() { Name = "double_yellow", Count = 2, Separation = 5f },
			new() { Name = "edge_white", Width = 5f },
			new() { Name = "no_stopping_red", Width = 4f, Count = 2, Separation = 4f }
		};
	}
}