< Summary

Information
Class: GridForge.Grids.Topology.GridBoundaryContactRunStamp
Assembly: GridForge
File(s): /home/runner/work/GridForge/GridForge/src/GridForge/Grids/Topology/GridBoundaryContactRunStamp.cs
Line coverage
100%
Covered lines: 14
Uncovered lines: 0
Coverable lines: 14
Total lines: 65
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%
Equals(...)100%44100%
Equals(...)100%22100%
GetHashCode()100%11100%
op_Equality(...)100%11100%
op_Inequality(...)100%11100%

File(s)

/home/runner/work/GridForge/GridForge/src/GridForge/Grids/Topology/GridBoundaryContactRunStamp.cs

#LineLine coverage
 1//=======================================================================
 2// GridBoundaryContactRunStamp.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 SwiftCollections.Utility;
 10
 11namespace GridForge.Grids.Topology;
 12
 13/// <summary>
 14/// Identifies the exact committed world revision bound by a boundary-contact cursor.
 15/// </summary>
 16public readonly struct GridBoundaryContactRunStamp : IEquatable<GridBoundaryContactRunStamp>
 17{
 18    /// <summary>The process-unique world allocation identity.</summary>
 19    public long WorldSpawnToken { get; }
 20
 21    /// <summary>The world-local structural generation.</summary>
 22    public uint WorldVersion { get; }
 23
 24    /// <summary>The committed world-local change sequence.</summary>
 25    public ulong ChangeSequence { get; }
 26
 27    internal GridBoundaryContactRunStamp(
 28        long worldSpawnToken,
 29        uint worldVersion,
 30        ulong changeSequence)
 31    {
 1732        WorldSpawnToken = worldSpawnToken;
 1733        WorldVersion = worldVersion;
 1734        ChangeSequence = changeSequence;
 1735    }
 36
 37    /// <inheritdoc />
 38    public bool Equals(GridBoundaryContactRunStamp other) =>
 1539        WorldSpawnToken == other.WorldSpawnToken
 1540        && WorldVersion == other.WorldVersion
 1541        && ChangeSequence == other.ChangeSequence;
 42
 43    /// <inheritdoc />
 44    public override bool Equals(object? obj) =>
 345        obj is GridBoundaryContactRunStamp other && Equals(other);
 46
 47    /// <inheritdoc />
 48    public override int GetHashCode()
 49    {
 250        int hash = SwiftHashTools.CombineHashCodes(
 251            WorldSpawnToken.GetHashCode(),
 252            WorldVersion.GetHashCode());
 253        return SwiftHashTools.CombineHashCodes(hash, ChangeSequence.GetHashCode());
 54    }
 55
 56    /// <inheritdoc />
 57    public static bool operator ==(
 58        GridBoundaryContactRunStamp left,
 259        GridBoundaryContactRunStamp right) => left.Equals(right);
 60
 61    /// <inheritdoc />
 62    public static bool operator !=(
 63        GridBoundaryContactRunStamp left,
 164        GridBoundaryContactRunStamp right) => !left.Equals(right);
 65}