< Summary

Information
Class: Trailblazer.Pathing.TraversalTransition
Assembly: Trailblazer
File(s): /home/runner/work/Trailblazer/Trailblazer/src/Trailblazer/Pathing/Transition/TraversalTransition.cs
Line coverage
100%
Covered lines: 11
Uncovered lines: 0
Coverable lines: 11
Total lines: 86
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%22100%

File(s)

/home/runner/work/Trailblazer/Trailblazer/src/Trailblazer/Pathing/Transition/TraversalTransition.cs

#LineLine coverage
 1using System;
 2
 3namespace Trailblazer.Pathing;
 4
 5/// <summary>
 6/// Represents an authored handoff between chart-backed traversal and/or raw volume traversal.
 7/// </summary>
 8[Serializable]
 9public readonly struct TraversalTransition
 10{
 11    /// <summary>
 12    /// Stable identifier for this transition within the global registry.
 13    /// </summary>
 14    public string Id { get; }
 15
 16    /// <summary>
 17    /// The authored handoff this transition represents.
 18    /// </summary>
 19    public TraversalTransitionType Type { get; }
 20
 21    /// <summary>
 22    /// The source anchor for this transition.
 23    /// </summary>
 24    public TraversalTransitionAnchor Source { get; }
 25
 26    /// <summary>
 27    /// The destination anchor for this transition.
 28    /// </summary>
 29    public TraversalTransitionAnchor Destination { get; }
 30
 31    /// <summary>
 32    /// Optional authored path cost adjustment for taking this transition.
 33    /// </summary>
 34    public int PathCostModifier { get; }
 35
 36    /// <summary>
 37    /// Whether this transition may be traversed in both directions.
 38    /// </summary>
 39    public bool IsBidirectional { get; }
 40
 41    /// <summary>
 42    /// Whether taking this transition should request climb intent for the active guided leg.
 43    /// </summary>
 44    public bool RequestsClimbIntent { get; }
 45
 46    /// <summary>
 47    /// Whether climb intent should remain active after a guided handoff follows this transition.
 48    /// </summary>
 49    public bool PreserveClimbIntentOnFollowup { get; }
 50
 51    /// <summary>
 52    /// Initializes a new instance of the TraversalTransition class, representing a transition between two traversal
 53    /// anchors with optional path cost and intent modifiers.
 54    /// </summary>
 55    /// <param name="id">The unique identifier for the transition. Cannot be null or whitespace.</param>
 56    /// <param name="type">The type of the transition, indicating how traversal occurs between the source and destinatio
 57    /// <param name="source">The anchor from which the transition originates.</param>
 58    /// <param name="destination">The anchor to which the transition leads.</param>
 59    /// <param name="pathCostModifier">An optional value that modifies the traversal path cost for this transition. Defa
 60    /// <param name="isBidirectional">true if the transition can be traversed in both directions; otherwise, false. Defa
 61    /// <param name="requestsClimbIntent">true if the transition requests a climb intent during traversal; otherwise, fa
 62    /// <param name="preserveClimbIntentOnFollowup">true if climb intent should be preserved on follow-up transitions; o
 63    /// <exception cref="ArgumentException">Thrown if id is null or consists only of whitespace.</exception>
 64    public TraversalTransition(
 65        string id,
 66        TraversalTransitionType type,
 67        TraversalTransitionAnchor source,
 68        TraversalTransitionAnchor destination,
 69        int pathCostModifier = 0,
 70        bool isBidirectional = false,
 71        bool requestsClimbIntent = false,
 72        bool preserveClimbIntentOnFollowup = false)
 73    {
 35574        if (string.IsNullOrWhiteSpace(id))
 375            throw new ArgumentException("Transition id cannot be null or whitespace.", nameof(id));
 76
 35277        Id = id;
 35278        Type = type;
 35279        Source = source;
 35280        Destination = destination;
 35281        PathCostModifier = pathCostModifier;
 35282        IsBidirectional = isBidirectional;
 35283        RequestsClimbIntent = requestsClimbIntent;
 35284        PreserveClimbIntentOnFollowup = preserveClimbIntentOnFollowup;
 35285    }
 86}