< Summary

Class:AttackBehaviorBase
Assembly:bamlab.micromissiles
File(s):/github/workspace/Assets/Scripts/Behavior/AttackBehaviorBase.cs
Covered lines:13
Uncovered lines:0
Coverable lines:13
Total lines:37
Line coverage:100% (13 of 13)
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
AttackBehaviorBase(...)0%110100%

File(s)

/github/workspace/Assets/Scripts/Behavior/AttackBehaviorBase.cs

#LineLine coverage
 1using UnityEngine;
 2
 3// Base implementation of an attack behavior.
 4public abstract class AttackBehaviorBase : IAttackBehavior {
 5  // Attack behavior configuration.
 6  private Configs.AttackBehaviorConfig _config;
 7
 8  // Flight plan.
 9  private FlightPlan _flightPlan;
 10
 11  // Agent that will execute the attack behavior.
 795012  public IAgent Agent { get; init; }
 13
 14  public Configs.AttackBehaviorConfig Config {
 95515    get => _config;
 95516    init => _config = value;
 17  }
 18
 19  public FlightPlan FlightPlan {
 3631920    get {
 3727421      if (_flightPlan == null) {
 95522        _flightPlan = new FlightPlan(Config?.FlightPlan);
 95523      }
 3631924      return _flightPlan;
 3631925    }
 26  }
 27
 191028  public AttackBehaviorBase(IAgent agent, Configs.AttackBehaviorConfig config) {
 95529    Agent = agent;
 95530    Config = config;
 95531  }
 32
 33  // Return the next waypoint for the agent to navigate to and the power setting to use towards the
 34  // waypoint.
 35  public abstract (Vector3 waypointPosition, Configs.Power power)
 36      GetNextWaypoint(in Vector3 targetPosition);
 37}