< Summary

Information
Class: GridForge.BoundsKey
Assembly: GridForge
File(s): /home/runner/work/GridForge/GridForge/src/GridForge/Support/BoundsKey.cs
Line coverage
100%
Covered lines: 1
Uncovered lines: 0
Coverable lines: 1
Total lines: 58
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
get_BoundsMin()100%11100%

File(s)

/home/runner/work/GridForge/GridForge/src/GridForge/Support/BoundsKey.cs

#LineLine coverage
 1#if !NET8_0_OR_GREATER
 2using System;
 3using SwiftCollections;
 4#endif
 5
 6using FixedMathSharp;
 7
 8namespace GridForge;
 9
 10/// <summary>
 11/// Exact identity key for a grid's snapped bounds.
 12/// </summary>
 13#if NET8_0_OR_GREATER
 214public readonly record struct BoundsKey(Vector3d BoundsMin, Vector3d BoundsMax);
 15#endif
 16
 17#if !NET8_0_OR_GREATER
 18public readonly struct BoundsKey : IEquatable<BoundsKey>
 19{
 20    /// <summary>
 21    /// The minimum bounds of the key.
 22    /// </summary>
 23    public Vector3d BoundsMin { get; }
 24
 25    /// <summary>
 26    /// The maximum bounds of the key.
 27    /// </summary>
 28    public Vector3d BoundsMax { get; }
 29
 30    /// <summary>
 31    /// Initializes a new instance of the BoundsKey class with the specified minimum and maximum coordinates.
 32    /// </summary>
 33    /// <remarks>
 34    /// Use this constructor to define the spatial limits of a bounding box by specifying its lower
 35    /// and upper corners.
 36    /// </remarks>
 37    /// <param name="boundsMin">The minimum corner of the bounding box, represented as a Vector3d.</param>
 38    /// <param name="boundsMax">The maximum corner of the bounding box, represented as a Vector3d.</param>
 39    public BoundsKey(Vector3d boundsMin, Vector3d boundsMax)
 40    {
 41        BoundsMin = boundsMin;
 42        BoundsMax = boundsMax;
 43    }
 44
 45    /// <inheritdoc />
 46    public override bool Equals(object obj)
 47    {
 48        return obj is BoundsKey other && Equals(other);
 49    }
 50
 51    /// <inheritdoc />
 52    public bool Equals(BoundsKey other) =>
 53        BoundsMin.Equals(other.BoundsMin) && BoundsMax.Equals(other.BoundsMax);
 54
 55    /// <inheritdoc />
 56    public override int GetHashCode() => SwiftHashTools.CombineHashCodes(BoundsMin, BoundsMax);
 57}
 58#endif

Methods/Properties

get_BoundsMin()