< Summary

Information
Class: Trailblazer.Pathing.NavigationCellEntry
Assembly: Trailblazer
File(s): /home/runner/work/Trailblazer/Trailblazer/src/Trailblazer/Pathing/Map/NavigationCellEntry.cs
Line coverage
100%
Covered lines: 8
Uncovered lines: 0
Coverable lines: 8
Total lines: 58
Line coverage: 100%
Branch coverage
100%
Covered branches: 4
Total branches: 4
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%
Equals(...)100%22100%
Equals(...)100%22100%
GetHashCode()100%11100%
op_Equality(...)100%11100%
op_Inequality(...)100%11100%

File(s)

/home/runner/work/Trailblazer/Trailblazer/src/Trailblazer/Pathing/Map/NavigationCellEntry.cs

#LineLine coverage
 1//=======================================================================
 2// NavigationCellEntry.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.Spatial;
 10using SwiftCollections.Utility;
 11
 12namespace Trailblazer.Pathing;
 13
 14/// <summary>
 15/// Associates one topology-local address with its immutable authored cell payload.
 16/// </summary>
 17public readonly struct NavigationCellEntry : IEquatable<NavigationCellEntry>
 18{
 19    /// <summary>
 20    /// The topology-local cell index.
 21    /// </summary>
 22    public VoxelIndex Index { get; }
 23
 24    /// <summary>
 25    /// The complete authored cell payload.
 26    /// </summary>
 27    public NavigationCell Cell { get; }
 28
 29    /// <summary>
 30    /// Creates an authored cell entry.
 31    /// </summary>
 32    public NavigationCellEntry(VoxelIndex index, NavigationCell cell)
 33    {
 2314634        Index = index;
 2314635        Cell = cell;
 2314636    }
 37
 38    /// <inheritdoc/>
 39    public bool Equals(NavigationCellEntry other) =>
 1940        Index.Equals(other.Index) && Cell.Equals(other.Cell);
 41
 42    /// <inheritdoc/>
 243    public override bool Equals(object? obj) => obj is NavigationCellEntry other && Equals(other);
 44
 45    /// <inheritdoc/>
 46    public override int GetHashCode() =>
 1447        SwiftHashTools.CombineHashCodes(Index.GetHashCode(), Cell.GetHashCode());
 48
 49    /// <summary>
 50    /// Tests two entries for value equality.
 51    /// </summary>
 152    public static bool operator ==(NavigationCellEntry left, NavigationCellEntry right) => left.Equals(right);
 53
 54    /// <summary>
 55    /// Tests two entries for value inequality.
 56    /// </summary>
 157    public static bool operator !=(NavigationCellEntry left, NavigationCellEntry right) => !left.Equals(right);
 58}