< Summary

Information
Class: Trailblazer.Pathing.VolumeSurveyResult
Assembly: Trailblazer
File(s): /home/runner/work/Trailblazer/Trailblazer/src/Trailblazer/Pathing/Search/Volume/VolumeSurveyResult.cs
Line coverage
100%
Covered lines: 17
Uncovered lines: 0
Coverable lines: 17
Total lines: 59
Line coverage: 100%
Branch coverage
100%
Covered branches: 6
Total branches: 6
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_HasPath()100%44100%
.cctor()100%11100%
.ctor()100%11100%
Create(...)100%22100%
Reset()100%11100%

File(s)

/home/runner/work/Trailblazer/Trailblazer/src/Trailblazer/Pathing/Search/Volume/VolumeSurveyResult.cs

#LineLine coverage
 1using System;
 2
 3namespace Trailblazer.Pathing;
 4
 5/// <summary>
 6/// Stores the reusable waypoint trail generated for a raw volume request.
 7/// </summary>
 8public sealed class VolumeSurveyResult : SurveyResult
 9{
 10    /// <summary>
 11    /// Gets the sequence of waypoints calculated by the A* pathfinding algorithm.
 12    /// </summary>
 13    public AStarWaypoint[]? Waypoints { get; private set; }
 14
 15    /// <inheritdoc/>
 101416    public override bool HasPath => IsValid && Waypoints != null && Waypoints.Length > 0;
 17
 18    /// <summary>
 19    /// Represents an empty result for a volume survey operation.
 20    /// </summary>
 21    /// <remarks>Use this field to represent a default or uninitialized state when no survey data is available.</remarks
 122    public static readonly VolumeSurveyResult Empty = new();
 23
 29224    private VolumeSurveyResult() { }
 25
 26    /// <summary>
 27    /// Creates a new instance of the VolumeSurveyResult class using the specified waypoints, charts, and key.
 28    /// </summary>
 29    /// <param name="context">The world context that owns the survey result.</param>
 30    /// <param name="waypoints">An array of AStarWaypoint objects representing the waypoints to include in the survey re
 31    /// <param name="chartsUtilized">An array of chart names that were utilized in the survey. If null, an empty array i
 32    /// <param name="key">A key used to identify or hash the request associated with this survey result.</param>
 33    /// <returns>A new VolumeSurveyResult instance initialized with the provided waypoints, charts, and key.</returns>
 34    public static VolumeSurveyResult Create(
 35        TrailblazerWorldContext context,
 36        AStarWaypoint[] waypoints,
 37        string[] chartsUtilized,
 38        int key)
 39    {
 14540        PathRequestContextResolver.ThrowIfUnusable(context);
 14541        return new VolumeSurveyResult()
 14542        {
 14543            IsValid = true,
 14544            IsInUse = false,
 14545            Context = context,
 14546            ChartsUtilized = chartsUtilized ?? Array.Empty<string>(),
 14547            Waypoints = waypoints,
 14548            LastUsedFrame = -1,
 14549            RequestHashKey = key
 14550        };
 51    }
 52
 53    /// <inheritdoc/>
 54    public override void Reset()
 55    {
 3156        base.Reset();
 3157        Waypoints = null;
 3158    }
 59}