< Summary

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

File(s)

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

#LineLine coverage
 1//=======================================================================
 2// GridCommittedChange.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
 8namespace GridForge.Grids;
 9
 10internal enum GridExactChangeKind : byte
 11{
 12    None = 0,
 13    ObstacleAdded = 1,
 14    ObstacleRemoved = 2,
 15    ObstaclesCleared = 3,
 16}
 17
 18internal readonly struct GridCommittedChange
 19{
 20    public readonly GridEventInfo GridEvent;
 21    public readonly GridExactChangeKind ExactKind;
 22    public readonly ObstacleEventInfo ObstacleEvent;
 23    public readonly ObstacleClearEventInfo ObstacleClearEvent;
 24    public readonly Voxel? TargetVoxel;
 25
 26    public GridCommittedChange(GridEventInfo gridEvent)
 27    {
 181528        GridEvent = gridEvent;
 181529        ExactKind = GridExactChangeKind.None;
 181530        ObstacleEvent = default;
 181531        ObstacleClearEvent = default;
 181532        TargetVoxel = null;
 181533    }
 34
 35    public GridCommittedChange(
 36        GridEventInfo gridEvent,
 37        GridExactChangeKind exactKind,
 38        ObstacleEventInfo obstacleEvent,
 39        Voxel targetVoxel)
 40    {
 111541        GridEvent = gridEvent;
 111542        ExactKind = exactKind;
 111543        ObstacleEvent = obstacleEvent;
 111544        ObstacleClearEvent = default;
 111545        TargetVoxel = targetVoxel;
 111546    }
 47
 48    public GridCommittedChange(
 49        GridEventInfo gridEvent,
 50        ObstacleClearEventInfo obstacleClearEvent,
 51        Voxel targetVoxel)
 52    {
 56553        GridEvent = gridEvent;
 56554        ExactKind = GridExactChangeKind.ObstaclesCleared;
 56555        ObstacleEvent = default;
 56556        ObstacleClearEvent = obstacleClearEvent;
 56557        TargetVoxel = targetVoxel;
 56558    }
 59}