< 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
 1611  public Configs.FlightPlan Config { get; init; }
 12
 13  public IReadOnlyList<Configs.FlightPlanWaypoint> Waypoints {
 5414    get {
 6215      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.
 3018        _waypoints = Config.Waypoints.OrderByDescending(waypoint => waypoint.Distance).ToList();
 819      }
 5420      return _waypoints.AsReadOnly();
 5421    }
 22  }
 23
 1624  public FlightPlan(Configs.FlightPlan config) {
 825    Config = config ?? new Configs.FlightPlan();
 826  }
 27}