< Summary

Information
Class: GridForge.Grids.GridEventInfo
Assembly: GridForge
File(s): /home/runner/work/GridForge/GridForge/src/GridForge/Grids/Support/GridEventInfo.cs
Line coverage
100%
Covered lines: 9
Uncovered lines: 0
Coverable lines: 9
Total lines: 67
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%
get_BoundsMax()100%11100%
.ctor(...)100%11100%
ToBoundsKey()100%11100%

File(s)

/home/runner/work/GridForge/GridForge/src/GridForge/Grids/Support/GridEventInfo.cs

#LineLine coverage
 1using FixedMathSharp;
 2using GridForge.Configuration;
 3
 4namespace GridForge.Grids;
 5
 6/// <summary>
 7/// Immutable snapshot describing a grid at the time a world grid notification is raised.
 8/// </summary>
 9public readonly struct GridEventInfo
 10{
 11    /// <summary>
 12    /// The runtime token of the owning <see cref="GridWorld"/> instance.
 13    /// </summary>
 14    public readonly int WorldSpawnToken;
 15
 16    /// <summary>
 17    /// The stable slot index assigned to the grid within <see cref="GridWorld.ActiveGrids"/>.
 18    /// </summary>
 19    public readonly ushort GridIndex;
 20
 21    /// <summary>
 22    /// The unique spawn token for the specific grid instance occupying <see cref="GridIndex"/>.
 23    /// </summary>
 24    public readonly int GridSpawnToken;
 25
 26    /// <summary>
 27    /// The snapped configuration for the grid when the notification was raised.
 28    /// </summary>
 29    public readonly GridConfiguration Configuration;
 30
 31    /// <summary>
 32    /// The per-grid version recorded when the notification was raised.
 33    /// </summary>
 34    public readonly uint GridVersion;
 35
 36    /// <summary>
 37    /// The minimum snapped bounds of the grid.
 38    /// </summary>
 1139    public readonly Vector3d BoundsMin => Configuration.BoundsMin;
 40
 41    /// <summary>
 42    /// The maximum snapped bounds of the grid.
 43    /// </summary>
 1044    public readonly Vector3d BoundsMax => Configuration.BoundsMax;
 45
 46    /// <summary>
 47    /// Initializes a new immutable grid event snapshot.
 48    /// </summary>
 49    public GridEventInfo(
 50        int worldSpawnToken,
 51        ushort gridIndex,
 52        int gridSpawnToken,
 53        GridConfiguration configuration,
 54        uint gridVersion)
 55    {
 143356        WorldSpawnToken = worldSpawnToken;
 143357        GridIndex = gridIndex;
 143358        GridSpawnToken = gridSpawnToken;
 143359        Configuration = configuration;
 143360        GridVersion = gridVersion;
 143361    }
 62
 63    /// <summary>
 64    /// Creates an exact bounds key from the stored grid configuration.
 65    /// </summary>
 166    public readonly BoundsKey ToBoundsKey() => Configuration.ToBoundsKey();
 67}