< Summary

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

Metrics

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

File(s)

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

#LineLine coverage
 1using UnityEngine;
 2
 3public class IdealSensor : Sensor {
 04  public override SensorOutput Sense(Agent agent) {
 05    SensorOutput agentSensorOutput = new SensorOutput();
 6
 7    // Adapt the relative transformation to the agent for the sensor output.
 08    Transformation relativeTransformation = _agent.GetRelativeTransformation(agent);
 09    agentSensorOutput.position = relativeTransformation.position;
 010    agentSensorOutput.velocity = relativeTransformation.velocity;
 11
 012    return agentSensorOutput;
 013  }
 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}