< 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: 66
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
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%
ContainsSelectionY(...)100%22100%

File(s)

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

#LineLine coverage
 1//=======================================================================
 2// HeightmapLayerRegistration.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 FixedMathSharp;
 9
 10namespace Trailblazer.Heightmaps;
 11
 12/// <summary>
 13/// Context-local registration metadata for one heightmap layer.
 14/// </summary>
 15public sealed class HeightmapLayerRegistration
 16{
 4017    internal HeightmapLayerRegistration(
 4018        HeightmapSurface surface,
 4019        Fixed64 minSelectionY,
 4020        Fixed64 maxSelectionY,
 4021        int priority,
 4022        int registrationOrder)
 23    {
 4024        Surface = surface;
 4025        LayerName = surface.Name;
 4026        MinSelectionY = minSelectionY;
 4027        MaxSelectionY = maxSelectionY;
 4028        Priority = priority;
 4029        RegistrationOrder = registrationOrder;
 4030    }
 31
 32    /// <summary>
 33    /// Stable registered layer name.
 34    /// </summary>
 35    public string LayerName { get; }
 36
 37    /// <summary>
 38    /// Compressed surface data used by this layer.
 39    /// </summary>
 40    public HeightmapSurface Surface { get; }
 41
 42    /// <summary>
 43    /// Inclusive lower contact-Y bound for selecting this layer.
 44    /// </summary>
 45    public Fixed64 MinSelectionY { get; }
 46
 47    /// <summary>
 48    /// Exclusive upper contact-Y bound for selecting this layer.
 49    /// </summary>
 50    public Fixed64 MaxSelectionY { get; }
 51
 52    /// <summary>
 53    /// Deterministic tie-break priority for overlapping layers.
 54    /// </summary>
 55    public int Priority { get; }
 56
 57    /// <summary>
 58    /// Deterministic context-local registration order.
 59    /// </summary>
 60    public int RegistrationOrder { get; }
 61
 62    internal bool ContainsSelectionY(Fixed64 contactY)
 63    {
 3664        return contactY >= MinSelectionY && contactY < MaxSelectionY;
 65    }
 66}