< Summary

Information
Class: Trailblazer.Heightmaps.HeightmapLayerRegistration
Assembly: Trailblazer
File(s): /home/runner/work/Trailblazer/Trailblazer/src/Trailblazer/Heightmaps/HeightmapLayerRegistration.cs
Line coverage
100%
Covered lines: 14
Uncovered lines: 0
Coverable lines: 14
Total lines: 60
Line coverage: 100%
Branch coverage
75%
Covered branches: 3
Total branches: 4
Branch coverage: 75%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)50%22100%
ContainsSelectionY(...)100%22100%

File(s)

/home/runner/work/Trailblazer/Trailblazer/src/Trailblazer/Heightmaps/HeightmapLayerRegistration.cs

#LineLine coverage
 1using FixedMathSharp;
 2using System;
 3
 4namespace Trailblazer.Heightmaps;
 5
 6/// <summary>
 7/// Context-local registration metadata for one heightmap layer.
 8/// </summary>
 9public sealed class HeightmapLayerRegistration
 10{
 3411    internal HeightmapLayerRegistration(
 3412        HeightmapSurface surface,
 3413        Fixed64 minSelectionY,
 3414        Fixed64 maxSelectionY,
 3415        int priority,
 3416        int registrationOrder)
 17    {
 3418        Surface = surface ?? throw new ArgumentNullException(nameof(surface));
 3419        LayerName = surface.Name;
 3420        MinSelectionY = minSelectionY;
 3421        MaxSelectionY = maxSelectionY;
 3422        Priority = priority;
 3423        RegistrationOrder = registrationOrder;
 3424    }
 25
 26    /// <summary>
 27    /// Stable registered layer name.
 28    /// </summary>
 29    public string LayerName { get; }
 30
 31    /// <summary>
 32    /// Compressed surface data used by this layer.
 33    /// </summary>
 34    public HeightmapSurface Surface { get; }
 35
 36    /// <summary>
 37    /// Inclusive lower contact-Y bound for selecting this layer.
 38    /// </summary>
 39    public Fixed64 MinSelectionY { get; }
 40
 41    /// <summary>
 42    /// Exclusive upper contact-Y bound for selecting this layer.
 43    /// </summary>
 44    public Fixed64 MaxSelectionY { get; }
 45
 46    /// <summary>
 47    /// Deterministic tie-break priority for overlapping layers.
 48    /// </summary>
 49    public int Priority { get; }
 50
 51    /// <summary>
 52    /// Deterministic context-local registration order.
 53    /// </summary>
 54    public int RegistrationOrder { get; }
 55
 56    internal bool ContainsSelectionY(Fixed64 contactY)
 57    {
 3058        return contactY >= MinSelectionY && contactY < MaxSelectionY;
 59    }
 60}