< Summary

Information
Class: GridForge.Grids.GridNavigationBodyTraceCandidate
Assembly: GridForge
File(s): /home/runner/work/GridForge/GridForge/src/GridForge/Grids/Support/GridNavigationBodyTraceCandidate.cs
Line coverage
100%
Covered lines: 27
Uncovered lines: 0
Coverable lines: 27
Total lines: 74
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%
WithPhysicalEvidence(...)100%11100%
WithVisited()100%11100%

File(s)

/home/runner/work/GridForge/GridForge/src/GridForge/Grids/Support/GridNavigationBodyTraceCandidate.cs

#LineLine coverage
 1//=======================================================================
 2// GridNavigationBodyTraceCandidate.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.Grids.Topology;
 9using GridForge.Spatial;
 10
 11namespace GridForge.Grids;
 12
 13internal readonly struct GridNavigationBodyTraceCandidate
 14{
 15    internal GridNavigationBodyTraceCandidate(
 16        VoxelGrid grid,
 17        VoxelIndex index,
 18        GridCellPrism prism,
 19        bool hasPositiveOverlap,
 20        bool isClosure,
 21        bool isPhysicallyPresent = false,
 22        ulong gridLastChangeSequence = 0UL,
 23        bool isVisited = false)
 24    {
 510025        Grid = grid;
 510026        Index = index;
 510027        Prism = prism;
 510028        HasPositiveOverlap = hasPositiveOverlap;
 510029        IsClosure = isClosure;
 510030        IsPhysicallyPresent = isPhysicallyPresent;
 510031        GridLastChangeSequence = gridLastChangeSequence;
 510032        IsVisited = isVisited;
 510033    }
 34
 35    internal VoxelGrid Grid { get; }
 36
 37    internal VoxelIndex Index { get; }
 38
 39    internal GridCellPrism Prism { get; }
 40
 41    internal bool HasPositiveOverlap { get; }
 42
 43    internal bool IsClosure { get; }
 44
 45    internal bool IsPhysicallyPresent { get; }
 46
 47    internal ulong GridLastChangeSequence { get; }
 48
 49    internal bool IsVisited { get; }
 50
 51    internal GridNavigationBodyTraceCandidate WithPhysicalEvidence(
 52        bool isPhysicallyPresent,
 53        ulong gridLastChangeSequence) =>
 170554        new(
 170555            Grid,
 170556            Index,
 170557            Prism,
 170558            HasPositiveOverlap,
 170559            IsClosure,
 170560            isPhysicallyPresent,
 170561            gridLastChangeSequence,
 170562            IsVisited);
 63
 64    internal GridNavigationBodyTraceCandidate WithVisited() =>
 165065        new(
 165066            Grid,
 165067            Index,
 165068            Prism,
 165069            HasPositiveOverlap,
 165070            IsClosure,
 165071            IsPhysicallyPresent,
 165072            GridLastChangeSequence,
 165073            isVisited: true);
 74}