< Summary

Information
Class: GridForge.Grids.OccupantEventInfo
Assembly: GridForge
File(s): /home/runner/work/GridForge/GridForge/src/GridForge/Grids/Support/OccupantEventInfo.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/OccupantEventInfo.cs

#LineLine coverage
 1using GridForge.Spatial;
 2
 3namespace GridForge.Grids;
 4
 5/// <summary>
 6/// Immutable snapshot describing an occupant mutation on a voxel.
 7/// </summary>
 8public readonly struct OccupantEventInfo
 9{
 10    /// <summary>
 11    /// The voxel affected by the occupant mutation.
 12    /// </summary>
 13    public readonly WorldVoxelIndex VoxelIndex;
 14
 15    /// <summary>
 16    /// The occupant that was added to or removed from the voxel.
 17    /// </summary>
 18    public readonly IVoxelOccupant Occupant;
 19
 20    /// <summary>
 21    /// The scan-cell ticket assigned to the occupant for this voxel.
 22    /// </summary>
 23    public readonly int Ticket;
 24
 25    /// <summary>
 26    /// The number of occupants on the voxel after the mutation completes.
 27    /// </summary>
 28    public readonly byte OccupantCount;
 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 occupant mutation snapshot.
 37    /// </summary>
 38    public OccupantEventInfo(
 39        WorldVoxelIndex voxelIndex,
 40        IVoxelOccupant occupant,
 41        int ticket,
 42        byte occupantCount)
 43    {
 46144        VoxelIndex = voxelIndex;
 46145        Occupant = occupant;
 46146        Ticket = ticket;
 46147        OccupantCount = occupantCount;
 46148    }
 49}