using MultiWheelC.TrajectoryPlanning.CoarsePath;

namespace MultiWheelC.TrajectoryPlanning.PathSmoothing;

/// <summary>平滑路径中方向一致的连续点范围；起止索引均包含在内。</summary>
public sealed class SmoothedPathSegment
{
    public SmoothedPathSegment(
        int segmentIndex,
        TravelDirection direction,
        int startIndex,
        int endIndex,
        bool startsAtGearSwitch,
        bool endsAtGearSwitch)
    {
        SegmentIndex = segmentIndex;
        Direction = direction;
        StartIndex = startIndex;
        EndIndex = endIndex;
        StartsAtGearSwitch = startsAtGearSwitch;
        EndsAtGearSwitch = endsAtGearSwitch;
    }

    /// <summary>从零开始的分段序号。</summary>
    public int SegmentIndex { get; }

    /// <summary>本段行驶方向。</summary>
    public TravelDirection Direction { get; }

    /// <summary>本段在平滑路径中的起始包含式索引。</summary>
    public int StartIndex { get; }

    /// <summary>本段在平滑路径中的结束包含式索引。</summary>
    public int EndIndex { get; }

    /// <summary>本段首点是否为换向后保留的新方向点。</summary>
    public bool StartsAtGearSwitch { get; }

    /// <summary>本段末点是否紧邻下一方向段的换向对。</summary>
    public bool EndsAtGearSwitch { get; }
}
