< Summary

Class:LaunchPlan
Assembly:bamlab.micromissiles
File(s):/github/workspace/Assets/Scripts/Algorithms/Planning/LaunchPlanner.cs
Covered lines:12
Uncovered lines:0
Coverable lines:12
Total lines:43
Line coverage:100% (12 of 12)
Covered branches:0
Total branches:0
Covered methods:6
Total methods:6
Method coverage:100% (6 of 6)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
LaunchPlan()0%110100%
LaunchPlan()0%110100%
LaunchPlan(...)0%110100%

File(s)

/github/workspace/Assets/Scripts/Algorithms/Planning/LaunchPlanner.cs

#LineLine coverage
 1using UnityEngine;
 2
 3// Launch planner output.
 4public class LaunchPlan {
 5  // No-launch launch plan.
 16  public static LaunchPlan NoLaunch = new LaunchPlan();
 7
 8  // Whether the interceptor should be launched.
 59  public bool ShouldLaunch { get; }
 10
 11  // Launch angle in degrees measured from the horizon.
 312  public float LaunchAngle { get; }
 13
 14  // Intercept position.
 315  public Vector3 InterceptPosition { get; }
 16
 217  public LaunchPlan() {
 118    ShouldLaunch = false;
 119  }
 620  public LaunchPlan(float launchAngle, Vector3 interceptPosition, bool shouldLaunch = true) {
 321    LaunchAngle = launchAngle;
 322    InterceptPosition = interceptPosition;
 323    ShouldLaunch = shouldLaunch;
 324  }
 25}
 26
 27// The launch planner class is an interface for planning when and where to launch an interceptor to
 28// intercept a target.
 29public abstract class ILaunchPlanner {
 30  // Launch angle planner.
 31  protected ILaunchAnglePlanner _launchAnglePlanner;
 32
 33  // Agent trajectory predictor.
 34  protected IPredictor _predictor;
 35
 36  public ILaunchPlanner(ILaunchAnglePlanner launchAnglePlanner, IPredictor predictor) {
 37    _launchAnglePlanner = launchAnglePlanner;
 38    _predictor = predictor;
 39  }
 40
 41  // Plan the launch.
 42  public abstract LaunchPlan Plan();
 43}