< Summary

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

File(s)

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

#LineLine coverage
 1using GridForge.Spatial;
 2
 3namespace GridForge.Grids;
 4
 5/// <summary>
 6/// Immutable snapshot describing a single obstacle mutation on a voxel.
 7/// </summary>
 8public readonly struct ObstacleEventInfo
 9{
 10    /// <summary>
 11    /// The voxel affected by the obstacle mutation.
 12    /// </summary>
 13    public readonly WorldVoxelIndex VoxelIndex;
 14
 15    /// <summary>
 16    /// The token identifying the obstacle that was added or removed.
 17    /// </summary>
 18    public readonly BoundsKey ObstacleToken;
 19
 20    /// <summary>
 21    /// The number of active obstacles on the voxel after the mutation completes.
 22    /// </summary>
 23    public readonly byte ObstacleCount;
 24
 25    /// <summary>
 26    /// The grid version recorded after the mutation completes.
 27    /// </summary>
 28    public readonly uint GridVersion;
 29
 30    /// <summary>
 31    /// The grid index containing <see cref="VoxelIndex"/>.
 32    /// </summary>
 133    public readonly ushort GridIndex => VoxelIndex.GridIndex;
 34
 35    /// <summary>
 36    /// Initializes a new immutable obstacle mutation snapshot.
 37    /// </summary>
 38    public ObstacleEventInfo(
 39        WorldVoxelIndex voxelIndex,
 40        BoundsKey obstacleToken,
 41        byte obstacleCount,
 42        uint gridVersion)
 43    {
 71644        VoxelIndex = voxelIndex;
 71645        ObstacleToken = obstacleToken;
 71646        ObstacleCount = obstacleCount;
 71647        GridVersion = gridVersion;
 71648    }
 49}