< Summary

Information
Class: Trailblazer.Pathing.NavigationCellOverlayOperation
Assembly: Trailblazer
File(s): /home/runner/work/Trailblazer/Trailblazer/src/Trailblazer/Pathing/Map/Overlay/NavigationCellOverlayOperation.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 62
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
Set(...)100%11100%
Suppress(...)100%11100%
RevertToBake(...)100%11100%

File(s)

/home/runner/work/Trailblazer/Trailblazer/src/Trailblazer/Pathing/Map/Overlay/NavigationCellOverlayOperation.cs

#LineLine coverage
 1//=======================================================================
 2// NavigationCellOverlayOperation.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.Spatial;
 9
 10namespace Trailblazer.Pathing;
 11
 12/// <summary>Identifies the final-state action for a semantic cell overlay entry.</summary>
 13public enum NavigationCellOverlayOperationKind
 14{
 15    /// <summary>Write a complete effective cell payload.</summary>
 16    Set = 0,
 17
 18    /// <summary>Tombstone effective traversal at the address.</summary>
 19    Suppress = 1,
 20
 21    /// <summary>Remove the override or tombstone and restore explicit, then default, authoring.</summary>
 22    RevertToBake = 2
 23}
 24
 25/// <summary>Describes one immutable addressed semantic-cell overlay operation.</summary>
 26public readonly struct NavigationCellOverlayOperation
 27{
 28    private NavigationCellOverlayOperation(
 29        VoxelIndex index,
 30        NavigationCellOverlayOperationKind kind,
 31        NavigationCell cell)
 32    {
 1735933        Index = index;
 1735934        Kind = kind;
 1735935        Cell = cell;
 1735936    }
 37
 38    /// <summary>Gets the topology-local address changed by this operation.</summary>
 39    public VoxelIndex Index { get; }
 40
 41    /// <summary>Gets the final-state operation kind.</summary>
 42    public NavigationCellOverlayOperationKind Kind { get; }
 43
 44    /// <summary>
 45    /// Gets the complete payload for <see cref="NavigationCellOverlayOperationKind.Set"/>.
 46    /// The value is ignored for suppression and reversion.
 47    /// </summary>
 48    public NavigationCell Cell { get; }
 49
 50    /// <summary>Creates a complete-payload Set operation.</summary>
 51    public static NavigationCellOverlayOperation Set(VoxelIndex index, NavigationCell cell) =>
 1719952        new(index, NavigationCellOverlayOperationKind.Set, cell);
 53
 54    /// <summary>Creates a tombstone operation.</summary>
 55    public static NavigationCellOverlayOperation Suppress(VoxelIndex index) =>
 10156        new(index, NavigationCellOverlayOperationKind.Suppress, default);
 57
 58    /// <summary>Creates an operation that restores explicit, then default, authoring.</summary>
 59    public static NavigationCellOverlayOperation RevertToBake(VoxelIndex index) =>
 5960        new(index, NavigationCellOverlayOperationKind.RevertToBake, default);
 61
 62}