< Summary

Class:IController
Assembly:bamlab.micromissiles
File(s):/github/workspace/Assets/Scripts/Controller/Controller.cs
Covered lines:7
Uncovered lines:7
Coverable lines:14
Total lines:30
Line coverage:50% (7 of 14)
Covered branches:0
Total branches:0
Covered methods:2
Total methods:4
Method coverage:50% (2 of 4)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
IController(...)0%110100%
Plan()0%2100%
PlanToWaypoint(...)0%110100%
PlanImpl(...)0%2100%

File(s)

/github/workspace/Assets/Scripts/Controller/Controller.cs

#LineLine coverage
 1using System;
 2using UnityEngine;
 3
 4// The controller class is an interface between the agent and its control law.
 5public class IController {
 6  // Agent that the controller is controlling.
 7  protected Agent _agent;
 8
 109  public IController(Agent agent) {
 510    _agent = agent;
 511  }
 12
 13  // Plan the next optimal control to intercept the target.
 014  public Vector3 Plan() {
 015    Transformation relativeTransformation =
 16        _agent.GetRelativeTransformation(_agent.GetTargetModel());
 017    return PlanImpl(relativeTransformation);
 018  }
 19
 20  // Plan the next optimal control to the waypoint.
 521  public Vector3 PlanToWaypoint(Vector3 waypoint) {
 522    Transformation relativeTransformation = _agent.GetRelativeTransformationToWaypoint(waypoint);
 523    return PlanImpl(relativeTransformation);
 524  }
 25
 26  // Controller-dependent implementation of the control law.
 027  protected virtual Vector3 PlanImpl(in Transformation relativeTransformation) {
 028    return Vector3.zero;
 029  }
 30}