< Summary

Information
Class: Trailblazer.Pathing.NavigationSemanticPage
Assembly: Trailblazer
File(s): /home/runner/work/Trailblazer/Trailblazer/src/Trailblazer/Pathing/Graph/NavigationSemanticPage.cs
Line coverage
100%
Covered lines: 16
Uncovered lines: 0
Coverable lines: 16
Total lines: 51
Line coverage: 100%
Branch coverage
100%
Covered branches: 6
Total branches: 6
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%11100%
Clone(...)100%11100%
IsEmpty()100%66100%

File(s)

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

#LineLine coverage
 1//=======================================================================
 2// NavigationSemanticPage.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
 8namespace Trailblazer.Pathing;
 9
 10internal sealed class NavigationSemanticPage
 11{
 12    internal const int SlotCount = 64;
 13
 1667414    internal NavigationSemanticPage(int pageIndex, long version = 0)
 15    {
 1667416        PageIndex = pageIndex;
 1667417        Version = version;
 1667418        HasOverride = new bool[SlotCount];
 1667419        IsSuppressed = new bool[SlotCount];
 1667420        Cells = new NavigationCell[SlotCount];
 1667421    }
 22
 23    internal int PageIndex { get; }
 24
 25    internal long Version { get; }
 26
 27    internal bool[] HasOverride { get; }
 28
 29    internal bool[] IsSuppressed { get; }
 30
 31    internal NavigationCell[] Cells { get; }
 32
 33    internal NavigationSemanticPage Clone(long version)
 34    {
 1625635        var clone = new NavigationSemanticPage(PageIndex, version);
 1625636        System.Array.Copy(HasOverride, clone.HasOverride, SlotCount);
 1625637        System.Array.Copy(IsSuppressed, clone.IsSuppressed, SlotCount);
 1625638        System.Array.Copy(Cells, clone.Cells, SlotCount);
 1625639        return clone;
 40    }
 41
 42    internal bool IsEmpty()
 43    {
 4009844        for (int i = 0; i < SlotCount; i++)
 45        {
 2000546            if (HasOverride[i] || IsSuppressed[i])
 1663047                return false;
 48        }
 4449        return true;
 50    }
 51}