< Summary

Information
Class: Trailblazer.Pathing.NavigationChartRegistration
Assembly: Trailblazer
File(s): /home/runner/work/Trailblazer/Trailblazer/src/Trailblazer/Pathing/Chart/NavigationChartRegistration.cs
Line coverage
100%
Covered lines: 13
Uncovered lines: 0
Coverable lines: 13
Total lines: 67
Line coverage: 100%
Branch coverage
75%
Covered branches: 3
Total branches: 4
Branch coverage: 75%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)75%44100%
get_Priority()100%11100%

File(s)

/home/runner/work/Trailblazer/Trailblazer/src/Trailblazer/Pathing/Chart/NavigationChartRegistration.cs

#LineLine coverage
 1using SwiftCollections;
 2using System;
 3
 4namespace Trailblazer.Pathing;
 5
 6/// <summary>
 7/// Stores live registration state for one authored <see cref="NavigationChart"/> inside a pathing owner.
 8/// </summary>
 9/// <remarks>
 10/// Authored chart data is reusable. Initialization state, same-priority overlap order, and managed
 11/// generated transition ids belong to the registration owned by a runtime context.
 12/// </remarks>
 13public sealed class NavigationChartRegistration
 14{
 15    /// <summary>
 16    /// Creates live registration state for an authored chart.
 17    /// </summary>
 18    /// <param name="chart">The authored chart data.</param>
 19    /// <param name="registrationOrder">The deterministic order assigned by the owner.</param>
 20    /// <param name="generatedTransitionIdPrefix">The prefix used for generated transition ids.</param>
 92121    public NavigationChartRegistration(
 92122        NavigationChart chart,
 92123        int registrationOrder,
 92124        string generatedTransitionIdPrefix)
 25    {
 92126        Chart = chart ?? throw new ArgumentNullException(nameof(chart));
 92127        if (string.IsNullOrWhiteSpace(generatedTransitionIdPrefix))
 28        {
 329            throw new ArgumentException(
 330                "Generated transition id prefix cannot be null or whitespace.",
 331                nameof(generatedTransitionIdPrefix));
 32        }
 33
 91834        RegistrationOrder = registrationOrder;
 91835        TransitionIdPrefix = generatedTransitionIdPrefix;
 91836    }
 37
 38    /// <summary>
 39    /// Gets the authored chart data.
 40    /// </summary>
 41    public NavigationChart Chart { get; }
 42
 43    /// <summary>
 44    /// Gets the deterministic registration order. Higher values win same-priority chart overlaps.
 45    /// </summary>
 46    public int RegistrationOrder { get; }
 47
 48    /// <summary>
 49    /// Gets whether the chart is currently materialized into live voxel state for this registration.
 50    /// </summary>
 51    public bool IsInitialized { get; internal set; }
 52
 53    /// <summary>
 54    /// Gets the generated transition id prefix for this chart registration.
 55    /// </summary>
 56    internal string TransitionIdPrefix { get; }
 57
 58    /// <summary>
 59    /// Gets the priority used for managed generated transitions created by this chart registration.
 60    /// </summary>
 461    internal int Priority => Chart.Priority;
 62
 63    /// <summary>
 64    /// Gets the managed generated transition ids currently associated with this registration.
 65    /// </summary>
 66    internal SwiftHashSet<string> TransitionIds { get; } = new();
 67}