< Summary

Class:FlightPlan
Assembly:bamlab.micromissiles
File(s):/github/workspace/Assets/Scripts/Behavior/FlightPlan.cs
Covered lines:10
Uncovered lines:0
Coverable lines:10
Total lines:27
Line coverage:100% (10 of 10)
Covered branches:0
Total branches:0
Covered methods:4
Total methods:4
Method coverage:100% (4 of 4)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
FlightPlan(...)0%220100%

File(s)

/github/workspace/Assets/Scripts/Behavior/FlightPlan.cs

#LineLine coverage
 1using System.Collections.Generic;
 2using System.Linq;
 3
 4// Flight plan.
 5//
 6// The flight plan contains a sorted list of waypoints for the agent on the way to the asset.
 7public class FlightPlan {
 8  // List of waypoints sorted by distance in descending order.
 9  private List<Configs.FlightPlanWaypoint> _waypoints;
 10
 191011  public Configs.FlightPlan Config { get; init; }
 12
 13  public IReadOnlyList<Configs.FlightPlanWaypoint> Waypoints {
 3631914    get {
 3727415      if (_waypoints == null) {
 16        // Sort the waypoints by distance in descending order to allow attack behaviors to iterate
 17        // from the farthest waypoint to the closest one.
 386218        _waypoints = Config.Waypoints.OrderByDescending(waypoint => waypoint.Distance).ToList();
 95519      }
 3631920      return _waypoints.AsReadOnly();
 3631921    }
 22  }
 23
 191024  public FlightPlan(Configs.FlightPlan config) {
 95525    Config = config ?? new Configs.FlightPlan();
 95526  }
 27}