Track/ShortcutPath.cs

Data container representing a baked shortcut path for races. Stores sampled waypoint positions, a RacingLine built from those points, entry/exit distances along the main racing line, risk and difficulty gating, and the total shortcut length.

namespace Machines.Race;

using Machines.Player;

/// <summary>
/// Baked shortcut alternative to the main racing line, from a "shortcut"-tagged spline.
/// </summary>
public sealed class ShortcutPath
{
	/// <summary>
	/// Baked waypoints sampled from the shortcut spline.
	/// </summary>
	public List<Vector3> Points { get; set; } = new();

	/// <summary>
	/// Full <see cref="RacingLine"/> built from the shortcut points; bots swap to this when taking it.
	/// </summary>
	public RacingLine Line { get; set; }

	/// <summary>
	/// Optimal-line distance where this shortcut's entry begins.
	/// </summary>
	public float EntryDistance { get; set; }

	/// <summary>
	/// Optimal-line distance where this shortcut rejoins.
	/// </summary>
	public float ExitDistance { get; set; }

	/// <summary>
	/// Risk level (0=trivial, 1=very risky); higher values reduce bot take-chance.
	/// </summary>
	public float RiskFactor { get; set; }

	/// <summary>
	/// Minimum bot difficulty required to even consider this shortcut.
	/// </summary>
	public BotDifficulty MinDifficulty { get; set; } = BotDifficulty.Easy;

	/// <summary>
	/// Total path length of this shortcut.
	/// </summary>
	public float TotalLength { get; set; }
}