< Summary

Information
Class: Trailblazer.Pathing.FlowFieldQueryOptions
Assembly: Trailblazer
File(s): /home/runner/work/Trailblazer/Trailblazer/src/Trailblazer/Pathing/Query/FlowFieldQueryOptions.cs
Line coverage
100%
Covered lines: 12
Uncovered lines: 0
Coverable lines: 12
Total lines: 53
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
Equals(...)100%11100%
Equals(...)100%22100%
GetHashCode()100%11100%
op_Equality(...)100%11100%
op_Inequality(...)100%11100%

File(s)

/home/runner/work/Trailblazer/Trailblazer/src/Trailblazer/Pathing/Query/FlowFieldQueryOptions.cs

#LineLine coverage
 1//=======================================================================
 2// FlowFieldQueryOptions.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
 8using System;
 9using FixedMathSharp;
 10
 11namespace Trailblazer.Pathing;
 12
 13/// <summary>
 14/// Defines immutable options specific to destination-centric flow field queries.
 15/// </summary>
 16public readonly struct FlowFieldQueryOptions : IEquatable<FlowFieldQueryOptions>
 17{
 18    /// <summary>
 19    /// Gets the non-negative additional integration cost applied by the flow query.
 20    /// </summary>
 21    public Fixed64 ExtraIntegrationCost { get; }
 22
 23    /// <summary>
 24    /// Creates immutable flow field query options.
 25    /// </summary>
 26    /// <exception cref="ArgumentOutOfRangeException">Thrown when the extra integration cost is negative.</exception>
 27    public FlowFieldQueryOptions(Fixed64 extraIntegrationCost)
 28    {
 73829        SwiftThrowHelper.ThrowIfArgumentOutOfRange(
 73830            extraIntegrationCost < Fixed64.Zero,
 73831            actualValue: null,
 73832            nameof(extraIntegrationCost),
 73833            "Extra integration cost cannot be negative.");
 34
 73735        ExtraIntegrationCost = extraIntegrationCost;
 73736    }
 37
 38    /// <inheritdoc/>
 380539    public bool Equals(FlowFieldQueryOptions other) => ExtraIntegrationCost == other.ExtraIntegrationCost;
 40
 41    /// <inheritdoc/>
 20442    public override bool Equals(object? obj) => obj is FlowFieldQueryOptions other && Equals(other);
 43
 44    /// <inheritdoc/>
 337245    public override int GetHashCode() => ExtraIntegrationCost.GetHashCode();
 46
 47    /// <summary>Returns whether two option values are exactly equal.</summary>
 242048    public static bool operator ==(FlowFieldQueryOptions left, FlowFieldQueryOptions right) => left.Equals(right);
 49
 50    /// <summary>Returns whether two option values differ.</summary>
 118251    public static bool operator !=(FlowFieldQueryOptions left, FlowFieldQueryOptions right) => !left.Equals(right);
 52
 53}