< Summary

Information
Class: Trailblazer.Pathing.NavigationGridBaselineCapture
Assembly: Trailblazer
File(s): /home/runner/work/Trailblazer/Trailblazer/src/Trailblazer/Pathing/Graph/NavigationGridBaselineCapture.cs
Line coverage
100%
Covered lines: 42
Uncovered lines: 0
Coverable lines: 42
Total lines: 116
Line coverage: 100%
Branch coverage
100%
Covered branches: 16
Total branches: 16
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%1212100%
.ctor(...)100%11100%
.ctor(...)100%11100%
get_HasBaseline()100%44100%

File(s)

/home/runner/work/Trailblazer/Trailblazer/src/Trailblazer/Pathing/Graph/NavigationGridBaselineCapture.cs

#LineLine coverage
 1//=======================================================================
 2// NavigationGridBaselineCapture.cs
 3//=======================================================================
 4// MIT License, Copyright (c) 2024-present David Oravsky (mrdav30)
 5// See LICENSE file in the project root for full license information.
 6//=======================================================================
 7
 8using GridForge.Configuration;
 9using GridForge.Grids;
 10
 11namespace Trailblazer.Pathing;
 12
 13/// <summary>Owns one detached GridForge address baseline captured during a short maintenance gate.</summary>
 14internal readonly struct NavigationGridBaselineCapture
 15{
 16    internal NavigationGridBaselineCapture(
 17        int addressCount,
 18        GridNavigationBaseline? baseline,
 19        bool isDelta)
 20    {
 106521        AddressCount = addressCount;
 106522        Baseline = baseline;
 106523        PreparedPages = null;
 106524        CapturedChangeSequence = baseline?.CapturedChangeSequence ?? 0;
 106525        WorldSpawnToken = baseline?.WorldSpawnToken ?? 0;
 106526        GridIndex = baseline?.GridIndex ?? ushort.MaxValue;
 106527        GridSpawnToken = baseline?.GridSpawnToken ?? 0;
 106528        GridLastChangeSequence = baseline?.GridLastChangeSequence ?? 0;
 106529        ConfigurationKey = baseline?.ConfigurationKey ?? default;
 106530        IsDelta = isDelta;
 106531        IsRequested = true;
 106532    }
 33
 34    internal NavigationGridBaselineCapture(
 35        int addressCount,
 36        PersistentIntMap<NavigationPhysicalPage> preparedPages,
 37        ulong capturedChangeSequence,
 38        long worldSpawnToken,
 39        ushort gridIndex,
 40        long gridSpawnToken,
 41        ulong gridLastChangeSequence,
 42        GridConfigurationKey configurationKey)
 43    {
 62844        AddressCount = addressCount;
 62845        Baseline = null;
 62846        PreparedPages = preparedPages;
 62847        CapturedChangeSequence = capturedChangeSequence;
 62848        WorldSpawnToken = worldSpawnToken;
 62849        GridIndex = gridIndex;
 62850        GridSpawnToken = gridSpawnToken;
 62851        GridLastChangeSequence = gridLastChangeSequence;
 62852        ConfigurationKey = configurationKey;
 62853        IsDelta = false;
 62854        IsRequested = true;
 62855    }
 56
 57    internal NavigationGridBaselineCapture(
 58        NavigationMapInstance preparedInstance,
 59        NavigationSurfaceComponentKeySet structuralChangedStates,
 60        bool defaultPhysicalAddressSetChanged,
 61        int addressCount,
 62        ulong capturedChangeSequence,
 63        long worldSpawnToken,
 64        ushort gridIndex,
 65        long gridSpawnToken,
 66        ulong gridLastChangeSequence,
 67        GridConfigurationKey configurationKey)
 68    {
 7469        AddressCount = addressCount;
 7470        Baseline = null;
 7471        PreparedPages = null;
 7472        PreparedInstance = preparedInstance;
 7473        StructuralChangedStates = structuralChangedStates;
 7474        DefaultPhysicalAddressSetChanged = defaultPhysicalAddressSetChanged;
 7475        CapturedChangeSequence = capturedChangeSequence;
 7476        WorldSpawnToken = worldSpawnToken;
 7477        GridIndex = gridIndex;
 7478        GridSpawnToken = gridSpawnToken;
 7479        GridLastChangeSequence = gridLastChangeSequence;
 7480        ConfigurationKey = configurationKey;
 7481        IsDelta = false;
 7482        IsRequested = true;
 7483    }
 84
 85    internal int AddressCount { get; }
 86
 87    internal GridNavigationBaseline? Baseline { get; }
 88
 89    internal PersistentIntMap<NavigationPhysicalPage>? PreparedPages { get; }
 90
 91    internal NavigationMapInstance? PreparedInstance { get; }
 92
 93    internal NavigationSurfaceComponentKeySet? StructuralChangedStates { get; }
 94
 95    internal bool DefaultPhysicalAddressSetChanged { get; }
 96
 97    internal ulong CapturedChangeSequence { get; }
 98
 99    internal long WorldSpawnToken { get; }
 100
 101    internal ushort GridIndex { get; }
 102
 103    internal long GridSpawnToken { get; }
 104
 105    internal ulong GridLastChangeSequence { get; }
 106
 107    internal GridConfigurationKey ConfigurationKey { get; }
 108
 109    internal bool IsDelta { get; }
 110
 111    internal bool IsRequested { get; }
 112
 1728113    internal bool HasBaseline => Baseline != null
 1728114        || PreparedPages != null
 1728115        || PreparedInstance != null;
 116}