< Summary

Information
Class: GridForge.Blockers.BoundsBlocker
Assembly: GridForge
File(s): /home/runner/work/GridForge/GridForge/src/GridForge/Blockers/BoundsBlocker.cs
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
Total lines: 34
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%
GetBoundsMin()100%11100%
GetBoundsMax()100%11100%

File(s)

/home/runner/work/GridForge/GridForge/src/GridForge/Blockers/BoundsBlocker.cs

#LineLine coverage
 1using FixedMathSharp;
 2using GridForge.Grids;
 3
 4namespace GridForge.Blockers;
 5
 6/// <summary>
 7/// A manually placed blocker that obstructs a defined bounding area.
 8/// </summary>
 9public class BoundsBlocker : Blocker
 10{
 11    private BoundingArea _blockArea;
 12
 13    /// <summary>
 14    /// Initializes a new bounds blocker bound to the supplied world.
 15    /// </summary>
 16    /// <param name="world">The world whose grids this blocker should affect.</param>
 17    /// <param name="blockArea">The bounding area to block.</param>
 18    /// <param name="isActive">Flag whether or not blocker is active.</param>
 19    /// <param name="cacheCoveredVoxels">Flag whether or not to cache covered voxels.</param>
 20    public BoundsBlocker(
 21        GridWorld world,
 22        BoundingArea blockArea,
 23        bool isActive = true,
 13524        bool cacheCoveredVoxels = false) : base(world, isActive, cacheCoveredVoxels)
 25    {
 13526        _blockArea = blockArea;
 13527    }
 28
 29    /// <inheritdoc cref="Blocker.GetBoundsMin"/>
 13830    protected override Vector3d GetBoundsMin() => _blockArea.Min;
 31
 32    /// <inheritdoc cref="Blocker.GetBoundsMax"/>
 13833    protected override Vector3d GetBoundsMax() => _blockArea.Max;
 34}