< Summary

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

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Sense(...)0%110100%
SenseWaypoint(...)0%2100%

File(s)

/github/workspace/Assets/Scripts/Sensors/IdealSensor.cs

#LineLine coverage
 1using UnityEngine;
 2
 3public class IdealSensor : Sensor {
 514  public override SensorOutput Sense(Agent agent) {
 515    SensorOutput agentSensorOutput = new SensorOutput();
 6
 7    // Adapt the relative transformation to the agent for the sensor output.
 518    Transformation relativeTransformation = _agent.GetRelativeTransformation(agent);
 509    agentSensorOutput.position = relativeTransformation.position;
 5010    agentSensorOutput.velocity = relativeTransformation.velocity;
 11
 5012    return agentSensorOutput;
 5013  }
 14
 015  public override SensorOutput SenseWaypoint(Vector3 waypoint) {
 016    SensorOutput waypointSensorOutput = new SensorOutput();
 17
 18    // Adapt the agent's relative transformation to the waypoint for the sensor output.
 019    Transformation relativeTransformation = _agent.GetRelativeTransformationToWaypoint(waypoint);
 020    waypointSensorOutput.position = relativeTransformation.position;
 021    waypointSensorOutput.velocity = relativeTransformation.velocity;
 22
 023    return waypointSensorOutput;
 024  }
 25}