Editor/Tunnel/ArchTunnelTypes.cs

Static helper that defines default tunnel type data for an editor. It returns a list of ArchTunnelType instances and contains factory methods for Bore, Underpass, Subway and Masonry with hardcoded numeric and string properties.

File Access
using System.Collections.Generic;

namespace Sunless.Architecture;

// Written out on first use and read back; a file on disk beats this table.
public static class ArchTunnelTypes
{
	public static List<ArchTunnelType> Defaults()
	{
		return new List<ArchTunnelType> { Bore(), Underpass(), Subway(), Masonry() };
	}

	static ArchTunnelType Bore()
	{
		return new ArchTunnelType
		{
			Name = "bore",
			Title = "Mountain bore",
			Description = "Horseshoe bore through rock - walkways both sides, concrete portal with a hood over the mouth.",
			Icon = "vpn_lock",
			Bore = new ArchTunnelPart
			{
				Bore = TunnelBore.Horseshoe,
				Headroom = 228f,
				Springing = 144f,
				Clearance = 30f,
				Lining = 20f,
				Invert = 16f,
				Segments = 6,
				Walkways = RoadSide.Both,
				WalkwayWidth = 48f,
				WalkwayHeight = 12f,
				Portals = true,
				PortalDepth = 42f,
				Collar = 96f,
				PortalRise = 48f,
				PortalReach = 84f,
				Hood = 60f,
				HoodDepth = 20f,
				WingWall = 180f,
				WingSplay = 40f,
				Coping = 6f,
				Bored = true
			}
		};
	}

	// One walkway - the other side is where the services run.
	static ArchTunnelType Underpass()
	{
		return new ArchTunnelType
		{
			Name = "underpass",
			Title = "Underpass",
			Description = "Cut and cover box under another road - square section, one walkway, plain concrete portal.",
			Icon = "horizontal_rule",
			Shows = new List<ArchTunnelGroup> { ArchTunnelGroup.Bore, ArchTunnelGroup.Walkway, ArchTunnelGroup.Portal, ArchTunnelGroup.Ground },
			Bore = new ArchTunnelPart
			{
				Bore = TunnelBore.Box,
				Headroom = 192f,
				Springing = 192f,
				Clearance = 18f,
				Lining = 24f,
				Invert = 18f,
				Segments = 1,
				Walkways = RoadSide.Right,
				WalkwayWidth = 42f,
				WalkwayHeight = 10f,
				Portals = true,
				PortalDepth = 30f,
				Collar = 48f,
				PortalRise = 30f,
				PortalReach = 60f,
				Hood = 0f,
				HoodDepth = 0f,
				WingWall = 144f,
				WingSplay = 45f,
				Coping = 5f,
				Bored = false
			}
		};
	}

	// The whole floor is one walkway, so none to add.
	static ArchTunnelType Subway()
	{
		return new ArchTunnelType
		{
			Name = "subway",
			Title = "Pedestrian subway",
			Description = "Narrow arched footway under a road - no walkways, shallow portal, tiled lining.",
			Icon = "directions_walk",
			Shows = new List<ArchTunnelGroup> { ArchTunnelGroup.Bore, ArchTunnelGroup.Portal, ArchTunnelGroup.Ground },
			Bore = new ArchTunnelPart
			{
				Bore = TunnelBore.Arch,
				Headroom = 108f,
				Springing = 60f,
				Clearance = 12f,
				Lining = 12f,
				Invert = 10f,
				Segments = 5,
				Walkways = RoadSide.None,
				Portals = true,
				PortalDepth = 24f,
				Collar = 36f,
				PortalRise = 24f,
				PortalReach = 42f,
				Hood = 18f,
				HoodDepth = 10f,
				WingWall = 96f,
				WingSplay = 50f,
				Coping = 4f,
				Bored = false
			}
		};
	}

	static ArchTunnelType Masonry()
	{
		return new ArchTunnelType
		{
			Name = "masonry",
			Title = "Masonry arch",
			Description = "Stone arch springing off the invert - coped headwall, no hood, one narrow walkway.",
			Icon = "castle",
			Bore = new ArchTunnelPart
			{
				Bore = TunnelBore.Arch,
				Headroom = 204f,
				Springing = 96f,
				Clearance = 24f,
				Lining = 26f,
				Invert = 14f,
				Segments = 8,
				Walkways = RoadSide.Left,
				WalkwayWidth = 36f,
				WalkwayHeight = 14f,
				Portals = true,
				PortalDepth = 48f,
				Collar = 84f,
				PortalRise = 36f,
				PortalReach = 96f,
				Hood = 0f,
				HoodDepth = 0f,
				WingWall = 156f,
				WingSplay = 35f,
				Coping = 10f,
				Bored = true
			}
		};
	}
}