< Summary

Information
Class: Trailblazer.Pathing.NavigationGridChangeScope
Assembly: Trailblazer
File(s): /home/runner/work/Trailblazer/Trailblazer/src/Trailblazer/Pathing/Graph/NavigationGridChangeScope.cs
Line coverage
100%
Covered lines: 12
Uncovered lines: 0
Coverable lines: 12
Total lines: 49
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%
.ctor(...)100%11100%
Equals(...)100%11100%
GetHashCode()100%11100%

File(s)

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

#LineLine coverage
 1//=======================================================================
 2// NavigationGridChangeScope.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 System;
 9using GridForge.Configuration;
 10using GridForge.Grids;
 11
 12namespace Trailblazer.Pathing;
 13
 14/// <summary>Identifies one configuration-local GridForge change scope and its observed generation.</summary>
 15internal readonly struct NavigationGridChangeScope : IEquatable<NavigationGridChangeScope>
 16{
 17    internal NavigationGridChangeScope(in GridEventInfo eventInfo)
 18    {
 246219        ConfigurationKey = eventInfo.Configuration.ToGridKey();
 246220        WorldSpawnToken = eventInfo.WorldSpawnToken;
 246221        GridIndex = eventInfo.GridIndex;
 246222        GridSpawnToken = eventInfo.GridSpawnToken;
 246223    }
 24
 25    internal NavigationGridChangeScope(
 26        GridConfigurationKey configurationKey,
 27        long worldSpawnToken,
 28        ushort gridIndex,
 29        long gridSpawnToken)
 30    {
 11831        ConfigurationKey = configurationKey;
 11832        WorldSpawnToken = worldSpawnToken;
 11833        GridIndex = gridIndex;
 11834        GridSpawnToken = gridSpawnToken;
 11835    }
 36
 37    internal GridConfigurationKey ConfigurationKey { get; }
 38
 39    internal long WorldSpawnToken { get; }
 40
 41    internal ushort GridIndex { get; }
 42
 43    internal long GridSpawnToken { get; }
 44
 45    public bool Equals(NavigationGridChangeScope other) =>
 172946        ConfigurationKey.Equals(other.ConfigurationKey);
 47
 548    public override int GetHashCode() => ConfigurationKey.GetHashCode();
 49}