< Summary

Information
Class: Trailblazer.Pathing.SurveyResult
Assembly: Trailblazer
File(s): /home/runner/work/Trailblazer/Trailblazer/src/Trailblazer/Pathing/Search/Survey/SurveyResult.cs
Line coverage
91%
Covered lines: 11
Uncovered lines: 1
Coverable lines: 12
Total lines: 56
Line coverage: 91.6%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_HasPath()100%210%
Checkout()100%11100%
Release()50%22100%
Reset()100%11100%

File(s)

/home/runner/work/Trailblazer/Trailblazer/src/Trailblazer/Pathing/Search/Survey/SurveyResult.cs

#LineLine coverage
 1using System;
 2
 3namespace Trailblazer.Pathing;
 4
 5/// <summary>
 6/// Represents the base class for survey result data, providing common state and behavior for survey result implementati
 7/// </summary>
 8/// <remarks>
 9/// This abstract class defines shared properties and methods used to manage the lifecycle and
 10/// state of survey results, such as validity, usage tracking, and chart utilization.
 11/// Derived classes should implement additional functionality specific to their survey result type.
 12/// Thread safety is not guaranteed; callers should ensure appropriate synchronization if instances are accessed concurr
 13/// </remarks>
 14public abstract class SurveyResult : ISurveyResult
 15{
 16    internal TrailblazerWorldContext? Context { get; set; }
 17
 18    /// <inheritdoc/>
 19    public bool IsValid { get; protected set; }
 20
 21    /// <inheritdoc/>
 22    public bool IsInUse { get; protected set; }
 23
 24    /// <inheritdoc/>
 25    public string[] ChartsUtilized { get; protected set; } = Array.Empty<string>();
 26
 27    /// <inheritdoc/>
 28    public int LastUsedFrame { get; protected set; }
 29
 30    /// <inheritdoc/>
 31    public int RequestHashKey { get; protected set; }
 32
 33    /// <inheritdoc/>
 034    public virtual bool HasPath => false;
 35
 36    /// <inheritdoc/>
 227037    public void Checkout() => IsInUse = true;
 38
 39    /// <inheritdoc/>
 40    public void Release()
 41    {
 220942        IsInUse = false;
 220943        LastUsedFrame = Context?.FrameCount ?? -1;
 220944    }
 45
 46    /// <inheritdoc/>
 47    public virtual void Reset()
 48    {
 26449        IsValid = false;
 26450        IsInUse = false;
 26451        Context = null;
 26452        ChartsUtilized = Array.Empty<string>();
 26453        LastUsedFrame = -1;
 26454        RequestHashKey = -1;
 26455    }
 56}